initImpl method
Future<void>
initImpl({
- RustLibApi? api,
- BaseHandler? handler,
- ExternalLibrary? externalLibrary,
inherited
This is only intended to be used by automatically generated code, instead of developers.
Implementation
@protected
Future<void> initImpl({
A? api,
BaseHandler? handler,
ExternalLibrary? externalLibrary,
}) async {
if (__state != null) {
throw StateError('Should not initialize flutter_rust_bridge twice');
}
_sanityCheckCodegenVersion();
externalLibrary ??= await _loadDefaultExternalLibrary();
handler ??= BaseHandler();
final generalizedFrbRustBinding =
GeneralizedFrbRustBinding(externalLibrary);
_sanityCheckContentHash(generalizedFrbRustBinding);
final portManager = PortManager(generalizedFrbRustBinding, handler);
api ??= _createDefaultApi(
handler, generalizedFrbRustBinding, portManager, externalLibrary);
__state = _EntrypointState(
generalizedFrbRustBinding: generalizedFrbRustBinding,
portManager: portManager,
api: api,
);
await executeRustInitializers();
}