Files
fil/docs/snippets/dart/plugins/stateful_plugin.md
Henrik Jess Nielsen b4c07d3693
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s
Nomad changes
2026-06-01 23:40:55 +02:00

960 B

import 'package:kreuzberg/kreuzberg.dart';

Future<void> main() async {
  // A stateful Dart `PostProcessor` that captures mutable counters in its
  // closure cannot be plugged into the global registry.
  // `Kreuzberg.registerPostProcessor(impl)` exists, but the
  // `createPostProcessorDartImpl` factory takes opaque `BoxFn*` closure
  // values whose constructors are not surfaced through flutter_rust_bridge,
  // so the closure-capture pattern is unreachable from Dart.
  //
  // Implement stateful plugins in Rust using `Mutex`/`AtomicU64` for
  // interior mutability, then register them in a Rust shim crate.
}