From 3f3dd4213ee5b193deef2bb4a88b7c8c61b986fe Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:08:28 +0800 Subject: [PATCH 01/17] chore: try to reproduce --- frb_example/dart_minimal/rust/src/api/minimal.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frb_example/dart_minimal/rust/src/api/minimal.rs b/frb_example/dart_minimal/rust/src/api/minimal.rs index 525e7e0774..57ae5e218d 100644 --- a/frb_example/dart_minimal/rust/src/api/minimal.rs +++ b/frb_example/dart_minimal/rust/src/api/minimal.rs @@ -9,3 +9,18 @@ pub fn init_app() { pub fn minimal_adder(a: i32, b: i32) -> i32 { a + b } + +#[frb(opaque)] +pub struct AnotherOpaqueType {} + +#[frb(opaque)] +pub struct MyOpaqueType { + pub sad: AnotherOpaqueType, +} + +pub fn foo() -> (MyOpaqueType, AnotherOpaqueType) { + todo!() +} +pub fn bar() -> AnotherOpaqueType { + todo!() +} From 83b6db2f68fa2419c9eaaeaa394db0b65fb2cd4c Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:10:11 +0800 Subject: [PATCH 02/17] chore: codegen --- frb_example/dart_minimal/frb_generated.h | 18 ++ .../lib/src/rust/api/minimal.dart | 44 ++++ .../lib/src/rust/frb_generated.dart | 218 ++++++++++++++++++ .../lib/src/rust/frb_generated.io.dart | 184 +++++++++++++++ .../lib/src/rust/frb_generated.web.dart | 142 ++++++++++++ .../dart_minimal/rust/src/frb_generated.io.rs | 72 ++++++ .../dart_minimal/rust/src/frb_generated.rs | 95 ++++++++ .../rust/src/frb_generated.web.rs | 77 +++++++ 8 files changed, 850 insertions(+) diff --git a/frb_example/dart_minimal/frb_generated.h b/frb_example/dart_minimal/frb_generated.h index 629f100abe..66e3e0dc6b 100644 --- a/frb_example/dart_minimal/frb_generated.h +++ b/frb_example/dart_minimal/frb_generated.h @@ -15,13 +15,31 @@ void frbgen_frb_example_dart_minimal_dart_fn_deliver_output(int32_t call_id, int32_t rust_vec_len_, int32_t data_len_); +void frbgen_frb_example_dart_minimal_wire_bar(int64_t port_); + +void frbgen_frb_example_dart_minimal_wire_foo(int64_t port_); + void frbgen_frb_example_dart_minimal_wire_init_app(int64_t port_); void frbgen_frb_example_dart_minimal_wire_minimal_adder(int64_t port_, int32_t a, int32_t b); + +void frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType(const void *ptr); + +void frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType(const void *ptr); + +void frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType(const void *ptr); + +void frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType(const void *ptr); static int64_t dummy_method_to_enforce_bundling(void) { int64_t dummy_var = 0; dummy_var ^= ((int64_t) (void*) drop_dart_object); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_dart_fn_deliver_output); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_wire_bar); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_wire_foo); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_wire_init_app); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_wire_minimal_adder); dummy_var ^= ((int64_t) (void*) get_dart_object); diff --git a/frb_example/dart_minimal/lib/src/rust/api/minimal.dart b/frb_example/dart_minimal/lib/src/rust/api/minimal.dart index ed41dd7399..2f68325460 100644 --- a/frb_example/dart_minimal/lib/src/rust/api/minimal.dart +++ b/frb_example/dart_minimal/lib/src/rust/api/minimal.dart @@ -8,3 +8,47 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; Future minimalAdder({required int a, required int b, dynamic hint}) => RustLib.instance.api.minimalAdder(a: a, b: b, hint: hint); + +Future foo({dynamic hint}) => + RustLib.instance.api.foo(hint: hint); + +Future bar({dynamic hint}) => + RustLib.instance.api.bar(hint: hint); + +// Rust type: flutter_rust_bridge::RustOpaque> +@sealed +class AnotherOpaqueType extends RustOpaque { + AnotherOpaqueType.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + AnotherOpaqueType.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_AnotherOpaqueType, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_AnotherOpaqueType, + rustArcDecrementStrongCountPtr: RustLib + .instance.api.rust_arc_decrement_strong_count_AnotherOpaqueTypePtr, + ); +} + +// Rust type: flutter_rust_bridge::RustOpaque> +@sealed +class MyOpaqueTypeAnotherOpaqueType extends RustOpaque { + MyOpaqueTypeAnotherOpaqueType.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + MyOpaqueTypeAnotherOpaqueType.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: RustLib.instance.api + .rust_arc_increment_strong_count_MyOpaqueTypeAnotherOpaqueType, + rustArcDecrementStrongCount: RustLib.instance.api + .rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueType, + rustArcDecrementStrongCountPtr: RustLib.instance.api + .rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr, + ); +} diff --git a/frb_example/dart_minimal/lib/src/rust/frb_generated.dart b/frb_example/dart_minimal/lib/src/rust/frb_generated.dart index 12cb9f6886..aaff00efc8 100644 --- a/frb_example/dart_minimal/lib/src/rust/frb_generated.dart +++ b/frb_example/dart_minimal/lib/src/rust/frb_generated.dart @@ -61,9 +61,31 @@ class RustLib extends BaseEntrypoint { } abstract class RustLibApi extends BaseApi { + Future bar({dynamic hint}); + + Future foo({dynamic hint}); + Future initApp({dynamic hint}); Future minimalAdder({required int a, required int b, dynamic hint}); + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_AnotherOpaqueType; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_AnotherOpaqueType; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_MyOpaqueTypeAnotherOpaqueType; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueType; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr; } class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @@ -74,6 +96,52 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { required super.portManager, }); + @override + Future bar({dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + return wire.wire_bar(port_); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType, + decodeErrorData: null, + ), + constMeta: kBarConstMeta, + argValues: [], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kBarConstMeta => const TaskConstMeta( + debugName: "bar", + argNames: [], + ); + + @override + Future foo({dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + return wire.wire_foo(port_); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType, + decodeErrorData: null, + ), + constMeta: kFooConstMeta, + argValues: [], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kFooConstMeta => const TaskConstMeta( + debugName: "foo", + argNames: [], + ); + @override Future initApp({dynamic hint}) { return handler.executeNormal(NormalTask( @@ -120,6 +188,49 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: ["a", "b"], ); + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_AnotherOpaqueType => wire + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_AnotherOpaqueType => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_MyOpaqueTypeAnotherOpaqueType => wire + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueType => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType; + + @protected + AnotherOpaqueType + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + dynamic raw) { + return AnotherOpaqueType.dcoDecode(raw as List); + } + + @protected + MyOpaqueTypeAnotherOpaqueType + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + dynamic raw) { + return MyOpaqueTypeAnotherOpaqueType.dcoDecode(raw as List); + } + + @protected + AnotherOpaqueType dco_decode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + dynamic raw) { + return AnotherOpaqueType.dcoDecode(raw as List); + } + + @protected + MyOpaqueTypeAnotherOpaqueType + dco_decode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + dynamic raw) { + return MyOpaqueTypeAnotherOpaqueType.dcoDecode(raw as List); + } + @protected int dco_decode_i_32(dynamic raw) { return raw as int; @@ -130,6 +241,42 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return; } + @protected + int dco_decode_usize(dynamic raw) { + return dcoDecodeI64OrU64(raw); + } + + @protected + AnotherOpaqueType + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + SseDeserializer deserializer) { + return AnotherOpaqueType.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + MyOpaqueTypeAnotherOpaqueType + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + SseDeserializer deserializer) { + return MyOpaqueTypeAnotherOpaqueType.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + AnotherOpaqueType sse_decode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + SseDeserializer deserializer) { + return AnotherOpaqueType.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + MyOpaqueTypeAnotherOpaqueType + sse_decode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + SseDeserializer deserializer) { + return MyOpaqueTypeAnotherOpaqueType.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + @protected int sse_decode_i_32(SseDeserializer deserializer) { return deserializer.buffer.getInt32(); @@ -138,11 +285,47 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_decode_unit(SseDeserializer deserializer) {} + @protected + int sse_decode_usize(SseDeserializer deserializer) { + return deserializer.buffer.getUint64(); + } + @protected bool sse_decode_bool(SseDeserializer deserializer) { return deserializer.buffer.getUint8() != 0; } + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + AnotherOpaqueType raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + MyOpaqueTypeAnotherOpaqueType raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + PlatformPointer cst_encode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + AnotherOpaqueType raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + MyOpaqueTypeAnotherOpaqueType raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + @protected int cst_encode_i_32(int raw) { return raw; @@ -153,6 +336,36 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return raw; } + @protected + int cst_encode_usize(int raw) { + return raw; + } + + @protected + void sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void sse_encode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void sse_encode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: null), serializer); + } + @protected void sse_encode_i_32(int self, SseSerializer serializer) { serializer.buffer.putInt32(self); @@ -161,6 +374,11 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_unit(void self, SseSerializer serializer) {} + @protected + void sse_encode_usize(int self, SseSerializer serializer) { + serializer.buffer.putUint64(self); + } + @protected void sse_encode_bool(bool self, SseSerializer serializer) { serializer.buffer.putUint8(self ? 1 : 0); diff --git a/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart b/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart index 78103e6aeb..ab3c23929c 100644 --- a/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart +++ b/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart @@ -18,33 +18,127 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { required super.portManager, }); + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueTypePtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueTypePtr; + + @protected + AnotherOpaqueType + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + dynamic raw); + + @protected + MyOpaqueTypeAnotherOpaqueType + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + dynamic raw); + + @protected + AnotherOpaqueType dco_decode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + dynamic raw); + + @protected + MyOpaqueTypeAnotherOpaqueType + dco_decode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + dynamic raw); + @protected int dco_decode_i_32(dynamic raw); @protected void dco_decode_unit(dynamic raw); + @protected + int dco_decode_usize(dynamic raw); + + @protected + AnotherOpaqueType + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + SseDeserializer deserializer); + + @protected + MyOpaqueTypeAnotherOpaqueType + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + SseDeserializer deserializer); + + @protected + AnotherOpaqueType sse_decode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + SseDeserializer deserializer); + + @protected + MyOpaqueTypeAnotherOpaqueType + sse_decode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + SseDeserializer deserializer); + @protected int sse_decode_i_32(SseDeserializer deserializer); @protected void sse_decode_unit(SseDeserializer deserializer); + @protected + int sse_decode_usize(SseDeserializer deserializer); + @protected bool sse_decode_bool(SseDeserializer deserializer); + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + AnotherOpaqueType raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + MyOpaqueTypeAnotherOpaqueType raw); + + @protected + PlatformPointer cst_encode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + AnotherOpaqueType raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + MyOpaqueTypeAnotherOpaqueType raw); + @protected int cst_encode_i_32(int raw); @protected void cst_encode_unit(void raw); + @protected + int cst_encode_usize(int raw); + + @protected + void sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); + + @protected + void sse_encode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer); + + @protected + void sse_encode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); + @protected void sse_encode_i_32(int self, SseSerializer serializer); @protected void sse_encode_unit(void self, SseSerializer serializer); + @protected + void sse_encode_usize(int self, SseSerializer serializer); + @protected void sse_encode_bool(bool self, SseSerializer serializer); } @@ -98,6 +192,32 @@ class RustLibWire implements BaseWire { late final _dart_fn_deliver_output = _dart_fn_deliver_outputPtr .asFunction, int, int)>(); + void wire_bar( + int port_, + ) { + return _wire_bar( + port_, + ); + } + + late final _wire_barPtr = + _lookup>( + 'frbgen_frb_example_dart_minimal_wire_bar'); + late final _wire_bar = _wire_barPtr.asFunction(); + + void wire_foo( + int port_, + ) { + return _wire_foo( + port_, + ); + } + + late final _wire_fooPtr = + _lookup>( + 'frbgen_frb_example_dart_minimal_wire_foo'); + late final _wire_foo = _wire_fooPtr.asFunction(); + void wire_init_app( int port_, ) { @@ -131,6 +251,70 @@ class RustLibWire implements BaseWire { late final _wire_minimal_adder = _wire_minimal_adderPtr.asFunction(); + void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueTypePtr = + _lookup)>>( + 'frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType'); + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType = + _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueTypePtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueTypePtr = + _lookup)>>( + 'frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType'); + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType = + _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueTypePtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueTypePtr = + _lookup)>>( + 'frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType'); + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType = + _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueTypePtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueTypePtr = + _lookup)>>( + 'frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType'); + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType = + _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueTypePtr + .asFunction)>(); + int dummy_method_to_enforce_bundling() { return _dummy_method_to_enforce_bundling(); } diff --git a/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart b/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart index 20690d5bd7..7cca2d1b93 100644 --- a/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart +++ b/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart @@ -17,33 +17,127 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { required super.portManager, }); + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType; + + @protected + AnotherOpaqueType + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + dynamic raw); + + @protected + MyOpaqueTypeAnotherOpaqueType + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + dynamic raw); + + @protected + AnotherOpaqueType dco_decode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + dynamic raw); + + @protected + MyOpaqueTypeAnotherOpaqueType + dco_decode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + dynamic raw); + @protected int dco_decode_i_32(dynamic raw); @protected void dco_decode_unit(dynamic raw); + @protected + int dco_decode_usize(dynamic raw); + + @protected + AnotherOpaqueType + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + SseDeserializer deserializer); + + @protected + MyOpaqueTypeAnotherOpaqueType + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + SseDeserializer deserializer); + + @protected + AnotherOpaqueType sse_decode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + SseDeserializer deserializer); + + @protected + MyOpaqueTypeAnotherOpaqueType + sse_decode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + SseDeserializer deserializer); + @protected int sse_decode_i_32(SseDeserializer deserializer); @protected void sse_decode_unit(SseDeserializer deserializer); + @protected + int sse_decode_usize(SseDeserializer deserializer); + @protected bool sse_decode_bool(SseDeserializer deserializer); + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + AnotherOpaqueType raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + MyOpaqueTypeAnotherOpaqueType raw); + + @protected + PlatformPointer cst_encode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + AnotherOpaqueType raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + MyOpaqueTypeAnotherOpaqueType raw); + @protected int cst_encode_i_32(int raw); @protected void cst_encode_unit(void raw); + @protected + int cst_encode_usize(int raw); + + @protected + void sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); + + @protected + void sse_encode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer); + + @protected + void sse_encode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); + @protected void sse_encode_i_32(int self, SseSerializer serializer); @protected void sse_encode_unit(void self, SseSerializer serializer); + @protected + void sse_encode_usize(int self, SseSerializer serializer); + @protected void sse_encode_bool(bool self, SseSerializer serializer); } @@ -58,10 +152,38 @@ class RustLibWire extends BaseWire { wasmModule.dart_fn_deliver_output( call_id, ptr_, rust_vec_len_, data_len_); + void wire_bar(NativePortType port_) => wasmModule.wire_bar(port_); + + void wire_foo(NativePortType port_) => wasmModule.wire_foo(port_); + void wire_init_app(NativePortType port_) => wasmModule.wire_init_app(port_); void wire_minimal_adder(NativePortType port_, int a, int b) => wasmModule.wire_minimal_adder(port_, a, b); + + void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + dynamic ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + dynamic ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + ptr); + + void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + dynamic ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + dynamic ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + ptr); } @JS('wasm_bindgen') @@ -79,7 +201,27 @@ class RustLibWasmModule implements WasmModule { external void dart_fn_deliver_output(int call_id, PlatformGeneralizedUint8ListPtr ptr_, int rust_vec_len_, int data_len_); + external void wire_bar(NativePortType port_); + + external void wire_foo(NativePortType port_); + external void wire_init_app(NativePortType port_); external void wire_minimal_adder(NativePortType port_, int a, int b); + + external void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + dynamic ptr); + + external void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + dynamic ptr); + + external void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + dynamic ptr); + + external void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + dynamic ptr); } diff --git a/frb_example/dart_minimal/rust/src/frb_generated.io.rs b/frb_example/dart_minimal/rust/src/frb_generated.io.rs index 038fdee752..a771e01fc9 100644 --- a/frb_example/dart_minimal/rust/src/frb_generated.io.rs +++ b/frb_example/dart_minimal/rust/src/frb_generated.io.rs @@ -4,12 +4,30 @@ // Section: imports use super::*; +use crate::api::minimal::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; use flutter_rust_bridge::for_generated::transform_result_dco; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: dart2rust +impl CstDecode>> + for *const std::ffi::c_void +{ + fn cst_decode(self) -> flutter_rust_bridge::RustOpaque> { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode>> + for *const std::ffi::c_void +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque> { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} pub trait NewWithNullPtr { fn new_with_null_ptr() -> Self; } @@ -37,6 +55,16 @@ pub extern "C" fn frbgen_frb_example_dart_minimal_dart_fn_deliver_output( FLUTTER_RUST_BRIDGE_HANDLER.dart_fn_handle_output(call_id, message) } +#[no_mangle] +pub extern "C" fn frbgen_frb_example_dart_minimal_wire_bar(port_: i64) { + wire_bar_impl(port_) +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_dart_minimal_wire_foo(port_: i64) { + wire_foo_impl(port_) +} + #[no_mangle] pub extern "C" fn frbgen_frb_example_dart_minimal_wire_init_app(port_: i64) { wire_init_app_impl(port_) @@ -46,3 +74,47 @@ pub extern "C" fn frbgen_frb_example_dart_minimal_wire_init_app(port_: i64) { pub extern "C" fn frbgen_frb_example_dart_minimal_wire_minimal_adder(port_: i64, a: i32, b: i32) { wire_minimal_adder_impl(port_, a, b) } + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock<(MyOpaqueType, AnotherOpaqueType)>, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock<(MyOpaqueType, AnotherOpaqueType)>, + >(ptr); + } +} diff --git a/frb_example/dart_minimal/rust/src/frb_generated.rs b/frb_example/dart_minimal/rust/src/frb_generated.rs index b3e77e7421..17633be31c 100644 --- a/frb_example/dart_minimal/rust/src/frb_generated.rs +++ b/frb_example/dart_minimal/rust/src/frb_generated.rs @@ -18,6 +18,7 @@ // Section: imports +use crate::api::minimal::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; use flutter_rust_bridge::for_generated::transform_result_dco; use flutter_rust_bridge::{Handler, IntoIntoDart}; @@ -32,6 +33,46 @@ flutter_rust_bridge::frb_generated_default_handler!(); // Section: wire_funcs +fn wire_bar_impl(port_: flutter_rust_bridge::for_generated::MessagePort) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "bar", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + move |context| { + transform_result_dco((move || { + Result::<_, ()>::Ok( + flutter_rust_bridge::for_generated::rust_auto_opaque_encode( + crate::api::minimal::bar(), + ), + ) + })()) + } + }, + ) +} +fn wire_foo_impl(port_: flutter_rust_bridge::for_generated::MessagePort) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "foo", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + move |context| { + transform_result_dco((move || { + Result::<_, ()>::Ok( + flutter_rust_bridge::for_generated::rust_auto_opaque_encode( + crate::api::minimal::foo(), + ), + ) + })()) + } + }, + ) +} fn wire_init_app_impl(port_: flutter_rust_bridge::for_generated::MessagePort) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { @@ -78,6 +119,27 @@ impl CstDecode for i32 { self } } +impl CstDecode for usize { + fn cst_decode(self) -> usize { + self + } +} +impl SseDecode for flutter_rust_bridge::RustOpaque> { + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { flutter_rust_bridge::for_generated::sse_decode_rust_opaque(inner) }; + } +} + +impl SseDecode + for flutter_rust_bridge::RustOpaque> +{ + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { flutter_rust_bridge::for_generated::sse_decode_rust_opaque(inner) }; + } +} + impl SseDecode for i32 { fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { deserializer.cursor.read_i32::().unwrap() @@ -88,6 +150,12 @@ impl SseDecode for () { fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {} } +impl SseDecode for usize { + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u64::().unwrap() as _ + } +} + impl SseDecode for bool { fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { deserializer.cursor.read_u8().unwrap() != 0 @@ -96,6 +164,24 @@ impl SseDecode for bool { // Section: rust2dart +impl SseEncode for flutter_rust_bridge::RustOpaque> { + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for flutter_rust_bridge::RustOpaque> +{ + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + impl SseEncode for i32 { fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { serializer.cursor.write_i32::(self).unwrap(); @@ -106,6 +192,15 @@ impl SseEncode for () { fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {} } +impl SseEncode for usize { + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer + .cursor + .write_u64::(self as _) + .unwrap(); + } +} + impl SseEncode for bool { fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { serializer.cursor.write_u8(self as _).unwrap(); diff --git a/frb_example/dart_minimal/rust/src/frb_generated.web.rs b/frb_example/dart_minimal/rust/src/frb_generated.web.rs index ca93c53d05..34041d38c4 100644 --- a/frb_example/dart_minimal/rust/src/frb_generated.web.rs +++ b/frb_example/dart_minimal/rust/src/frb_generated.web.rs @@ -4,6 +4,7 @@ // Section: imports use super::*; +use crate::api::minimal::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; use flutter_rust_bridge::for_generated::transform_result_dco; use flutter_rust_bridge::for_generated::wasm_bindgen; @@ -20,11 +21,33 @@ where (!self.is_null() && !self.is_undefined()).then(|| self.cst_decode()) } } +impl CstDecode>> + for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue +{ + fn cst_decode(self) -> flutter_rust_bridge::RustOpaque> { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode>> + for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque> { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { fn cst_decode(self) -> i32 { self.unchecked_into_f64() as _ } } +impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { + fn cst_decode(self) -> usize { + self.unchecked_into_f64() as _ + } +} #[wasm_bindgen] pub fn dart_fn_deliver_output( @@ -43,6 +66,16 @@ pub fn dart_fn_deliver_output( FLUTTER_RUST_BRIDGE_HANDLER.dart_fn_handle_output(call_id, message) } +#[wasm_bindgen] +pub fn wire_bar(port_: flutter_rust_bridge::for_generated::MessagePort) { + wire_bar_impl(port_) +} + +#[wasm_bindgen] +pub fn wire_foo(port_: flutter_rust_bridge::for_generated::MessagePort) { + wire_foo_impl(port_) +} + #[wasm_bindgen] pub fn wire_init_app(port_: flutter_rust_bridge::for_generated::MessagePort) { wire_init_app_impl(port_) @@ -52,3 +85,47 @@ pub fn wire_init_app(port_: flutter_rust_bridge::for_generated::MessagePort) { pub fn wire_minimal_adder(port_: flutter_rust_bridge::for_generated::MessagePort, a: i32, b: i32) { wire_minimal_adder_impl(port_, a, b) } + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock<(MyOpaqueType, AnotherOpaqueType)>, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock<(MyOpaqueType, AnotherOpaqueType)>, + >(ptr); + } +} From 17ab95226acd7ccaf274b9f75797de7ff5b5a026 Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:10:32 +0800 Subject: [PATCH 03/17] chore: another repro --- frb_example/dart_minimal/frb_generated.h | 16 +-- .../lib/src/rust/api/minimal.dart | 24 ++-- .../lib/src/rust/frb_generated.dart | 95 ++++++++------- .../lib/src/rust/frb_generated.io.dart | 115 +++++++++--------- .../lib/src/rust/frb_generated.web.dart | 91 +++++++------- .../dart_minimal/rust/src/api/minimal.rs | 10 +- .../dart_minimal/rust/src/frb_generated.io.rs | 50 +++++--- .../dart_minimal/rust/src/frb_generated.rs | 22 +++- .../rust/src/frb_generated.web.rs | 50 +++++--- 9 files changed, 272 insertions(+), 201 deletions(-) diff --git a/frb_example/dart_minimal/frb_generated.h b/frb_example/dart_minimal/frb_generated.h index 66e3e0dc6b..94a4d0c877 100644 --- a/frb_example/dart_minimal/frb_generated.h +++ b/frb_example/dart_minimal/frb_generated.h @@ -23,21 +23,21 @@ void frbgen_frb_example_dart_minimal_wire_init_app(int64_t port_); void frbgen_frb_example_dart_minimal_wire_minimal_adder(int64_t port_, int32_t a, int32_t b); -void frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType(const void *ptr); +void frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType(const void *ptr); -void frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType(const void *ptr); +void frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType(const void *ptr); -void frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType(const void *ptr); +void frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType(const void *ptr); -void frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType(const void *ptr); +void frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType(const void *ptr); static int64_t dummy_method_to_enforce_bundling(void) { int64_t dummy_var = 0; dummy_var ^= ((int64_t) (void*) drop_dart_object); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_dart_fn_deliver_output); - dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType); - dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType); - dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType); - dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_wire_bar); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_wire_foo); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_wire_init_app); diff --git a/frb_example/dart_minimal/lib/src/rust/api/minimal.dart b/frb_example/dart_minimal/lib/src/rust/api/minimal.dart index 2f68325460..84ee41b454 100644 --- a/frb_example/dart_minimal/lib/src/rust/api/minimal.dart +++ b/frb_example/dart_minimal/lib/src/rust/api/minimal.dart @@ -9,13 +9,13 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; Future minimalAdder({required int a, required int b, dynamic hint}) => RustLib.instance.api.minimalAdder(a: a, b: b, hint: hint); -Future foo({dynamic hint}) => +Future foo({dynamic hint}) => RustLib.instance.api.foo(hint: hint); Future bar({dynamic hint}) => RustLib.instance.api.bar(hint: hint); -// Rust type: flutter_rust_bridge::RustOpaque> +// Rust type: flutter_rust_bridge::RustOpaque> @sealed class AnotherOpaqueType extends RustOpaque { AnotherOpaqueType.dcoDecode(List wire) @@ -34,21 +34,21 @@ class AnotherOpaqueType extends RustOpaque { ); } -// Rust type: flutter_rust_bridge::RustOpaque> +// Rust type: flutter_rust_bridge::RustOpaque> @sealed -class MyOpaqueTypeAnotherOpaqueType extends RustOpaque { - MyOpaqueTypeAnotherOpaqueType.dcoDecode(List wire) +class AnotherOpaqueType extends RustOpaque { + AnotherOpaqueType.dcoDecode(List wire) : super.dcoDecode(wire, _kStaticData); - MyOpaqueTypeAnotherOpaqueType.sseDecode(int ptr, int externalSizeOnNative) + AnotherOpaqueType.sseDecode(int ptr, int externalSizeOnNative) : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); static final _kStaticData = RustArcStaticData( - rustArcIncrementStrongCount: RustLib.instance.api - .rust_arc_increment_strong_count_MyOpaqueTypeAnotherOpaqueType, - rustArcDecrementStrongCount: RustLib.instance.api - .rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueType, - rustArcDecrementStrongCountPtr: RustLib.instance.api - .rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr, + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_AnotherOpaqueType, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_AnotherOpaqueType, + rustArcDecrementStrongCountPtr: RustLib + .instance.api.rust_arc_decrement_strong_count_AnotherOpaqueTypePtr, ); } diff --git a/frb_example/dart_minimal/lib/src/rust/frb_generated.dart b/frb_example/dart_minimal/lib/src/rust/frb_generated.dart index aaff00efc8..31ab5d5dba 100644 --- a/frb_example/dart_minimal/lib/src/rust/frb_generated.dart +++ b/frb_example/dart_minimal/lib/src/rust/frb_generated.dart @@ -63,7 +63,7 @@ class RustLib extends BaseEntrypoint { abstract class RustLibApi extends BaseApi { Future bar({dynamic hint}); - Future foo({dynamic hint}); + Future foo({dynamic hint}); Future initApp({dynamic hint}); @@ -79,13 +79,13 @@ abstract class RustLibApi extends BaseApi { get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_MyOpaqueTypeAnotherOpaqueType; + get rust_arc_increment_strong_count_AnotherOpaqueType; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueType; + get rust_arc_decrement_strong_count_AnotherOpaqueType; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr; + get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr; } class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @@ -104,7 +104,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { }, codec: DcoCodec( decodeSuccessData: - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType, + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType, decodeErrorData: null, ), constMeta: kBarConstMeta, @@ -120,14 +120,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future foo({dynamic hint}) { + Future foo({dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { return wire.wire_foo(port_); }, codec: DcoCodec( decodeSuccessData: - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType, + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType, decodeErrorData: null, ), constMeta: kFooConstMeta, @@ -190,45 +190,46 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_AnotherOpaqueType => wire - .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType; + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType; RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_AnotherOpaqueType => wire - .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType; + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_MyOpaqueTypeAnotherOpaqueType => wire - .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType; + get rust_arc_increment_strong_count_AnotherOpaqueType => wire + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueType => wire - .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType; + get rust_arc_decrement_strong_count_AnotherOpaqueType => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType; @protected AnotherOpaqueType - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( dynamic raw) { return AnotherOpaqueType.dcoDecode(raw as List); } @protected - MyOpaqueTypeAnotherOpaqueType - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + AnotherOpaqueType + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic raw) { - return MyOpaqueTypeAnotherOpaqueType.dcoDecode(raw as List); + return AnotherOpaqueType.dcoDecode(raw as List); } @protected - AnotherOpaqueType dco_decode_RustOpaque_stdsyncRwLockAnotherOpaqueType( - dynamic raw) { + AnotherOpaqueType + dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( + dynamic raw) { return AnotherOpaqueType.dcoDecode(raw as List); } @protected - MyOpaqueTypeAnotherOpaqueType - dco_decode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + AnotherOpaqueType + dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic raw) { - return MyOpaqueTypeAnotherOpaqueType.dcoDecode(raw as List); + return AnotherOpaqueType.dcoDecode(raw as List); } @protected @@ -248,32 +249,33 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected AnotherOpaqueType - sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( SseDeserializer deserializer) { return AnotherOpaqueType.sseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected - MyOpaqueTypeAnotherOpaqueType - sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + AnotherOpaqueType + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( SseDeserializer deserializer) { - return MyOpaqueTypeAnotherOpaqueType.sseDecode( + return AnotherOpaqueType.sseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected - AnotherOpaqueType sse_decode_RustOpaque_stdsyncRwLockAnotherOpaqueType( - SseDeserializer deserializer) { + AnotherOpaqueType + sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( + SseDeserializer deserializer) { return AnotherOpaqueType.sseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected - MyOpaqueTypeAnotherOpaqueType - sse_decode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + AnotherOpaqueType + sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( SseDeserializer deserializer) { - return MyOpaqueTypeAnotherOpaqueType.sseDecode( + return AnotherOpaqueType.sseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @@ -297,7 +299,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected PlatformPointer - cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( AnotherOpaqueType raw) { // ignore: invalid_use_of_internal_member return raw.cstEncode(move: true); @@ -305,23 +307,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected PlatformPointer - cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType raw) { + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( + AnotherOpaqueType raw) { // ignore: invalid_use_of_internal_member return raw.cstEncode(move: true); } @protected - PlatformPointer cst_encode_RustOpaque_stdsyncRwLockAnotherOpaqueType( - AnotherOpaqueType raw) { + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( + AnotherOpaqueType raw) { // ignore: invalid_use_of_internal_member return raw.cstEncode(); } @protected PlatformPointer - cst_encode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType raw) { + cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( + AnotherOpaqueType raw) { // ignore: invalid_use_of_internal_member return raw.cstEncode(); } @@ -342,27 +345,29 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } @protected - void sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer) { + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer) { sse_encode_usize(self.sseEncode(move: true), serializer); } @protected void - sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer) { + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer) { sse_encode_usize(self.sseEncode(move: true), serializer); } @protected - void sse_encode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + void sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( AnotherOpaqueType self, SseSerializer serializer) { sse_encode_usize(self.sseEncode(move: null), serializer); } @protected - void sse_encode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer) { + void + sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer) { sse_encode_usize(self.sseEncode(move: null), serializer); } diff --git a/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart b/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart index ab3c23929c..bc956b24a0 100644 --- a/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart +++ b/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart @@ -20,29 +20,30 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr => wire - ._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueTypePtr; + ._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueTypePtr; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr => wire - ._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueTypePtr; + get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueTypePtr; @protected AnotherOpaqueType - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( dynamic raw); @protected - MyOpaqueTypeAnotherOpaqueType - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + AnotherOpaqueType + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic raw); @protected - AnotherOpaqueType dco_decode_RustOpaque_stdsyncRwLockAnotherOpaqueType( - dynamic raw); + AnotherOpaqueType + dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( + dynamic raw); @protected - MyOpaqueTypeAnotherOpaqueType - dco_decode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + AnotherOpaqueType + dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic raw); @protected @@ -56,21 +57,22 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected AnotherOpaqueType - sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( SseDeserializer deserializer); @protected - MyOpaqueTypeAnotherOpaqueType - sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + AnotherOpaqueType + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( SseDeserializer deserializer); @protected - AnotherOpaqueType sse_decode_RustOpaque_stdsyncRwLockAnotherOpaqueType( - SseDeserializer deserializer); + AnotherOpaqueType + sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( + SseDeserializer deserializer); @protected - MyOpaqueTypeAnotherOpaqueType - sse_decode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + AnotherOpaqueType + sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( SseDeserializer deserializer); @protected @@ -87,22 +89,23 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected PlatformPointer - cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( AnotherOpaqueType raw); @protected PlatformPointer - cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType raw); + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( + AnotherOpaqueType raw); @protected - PlatformPointer cst_encode_RustOpaque_stdsyncRwLockAnotherOpaqueType( - AnotherOpaqueType raw); + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( + AnotherOpaqueType raw); @protected PlatformPointer - cst_encode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType raw); + cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( + AnotherOpaqueType raw); @protected int cst_encode_i_32(int raw); @@ -114,21 +117,23 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { int cst_encode_usize(int raw); @protected - void sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer); + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer); @protected void - sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer); @protected - void sse_encode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + void sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( AnotherOpaqueType self, SseSerializer serializer); @protected - void sse_encode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); + void + sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer); @protected void sse_encode_i_32(int self, SseSerializer serializer); @@ -252,67 +257,67 @@ class RustLibWire implements BaseWire { _wire_minimal_adderPtr.asFunction(); void - rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( ffi.Pointer ptr, ) { - return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( ptr, ); } - late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueTypePtr = + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueTypePtr = _lookup)>>( - 'frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType'); - late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType = - _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueTypePtr + 'frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType'); + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType = + _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueTypePtr .asFunction)>(); void - rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( ffi.Pointer ptr, ) { - return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( ptr, ); } - late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueTypePtr = + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueTypePtr = _lookup)>>( - 'frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType'); - late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType = - _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueTypePtr + 'frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType'); + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType = + _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueTypePtr .asFunction)>(); void - rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( ffi.Pointer ptr, ) { - return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( ptr, ); } - late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueTypePtr = + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueTypePtr = _lookup)>>( - 'frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType'); - late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType = - _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueTypePtr + 'frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType'); + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType = + _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueTypePtr .asFunction)>(); void - rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( ffi.Pointer ptr, ) { - return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( ptr, ); } - late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueTypePtr = + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueTypePtr = _lookup)>>( - 'frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType'); - late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType = - _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueTypePtr + 'frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType'); + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType = + _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueTypePtr .asFunction)>(); int dummy_method_to_enforce_bundling() { diff --git a/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart b/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart index 7cca2d1b93..10237f96ef 100644 --- a/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart +++ b/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart @@ -19,29 +19,30 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr => wire - .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType; + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr => wire - .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType; + get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType; @protected AnotherOpaqueType - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( dynamic raw); @protected - MyOpaqueTypeAnotherOpaqueType - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + AnotherOpaqueType + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic raw); @protected - AnotherOpaqueType dco_decode_RustOpaque_stdsyncRwLockAnotherOpaqueType( - dynamic raw); + AnotherOpaqueType + dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( + dynamic raw); @protected - MyOpaqueTypeAnotherOpaqueType - dco_decode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + AnotherOpaqueType + dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic raw); @protected @@ -55,21 +56,22 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected AnotherOpaqueType - sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( SseDeserializer deserializer); @protected - MyOpaqueTypeAnotherOpaqueType - sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + AnotherOpaqueType + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( SseDeserializer deserializer); @protected - AnotherOpaqueType sse_decode_RustOpaque_stdsyncRwLockAnotherOpaqueType( - SseDeserializer deserializer); + AnotherOpaqueType + sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( + SseDeserializer deserializer); @protected - MyOpaqueTypeAnotherOpaqueType - sse_decode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + AnotherOpaqueType + sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( SseDeserializer deserializer); @protected @@ -86,22 +88,23 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected PlatformPointer - cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( AnotherOpaqueType raw); @protected PlatformPointer - cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType raw); + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( + AnotherOpaqueType raw); @protected - PlatformPointer cst_encode_RustOpaque_stdsyncRwLockAnotherOpaqueType( - AnotherOpaqueType raw); + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( + AnotherOpaqueType raw); @protected PlatformPointer - cst_encode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType raw); + cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( + AnotherOpaqueType raw); @protected int cst_encode_i_32(int raw); @@ -113,21 +116,23 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { int cst_encode_usize(int raw); @protected - void sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer); + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer); @protected void - sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer); @protected - void sse_encode_RustOpaque_stdsyncRwLockAnotherOpaqueType( + void sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( AnotherOpaqueType self, SseSerializer serializer); @protected - void sse_encode_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); + void + sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( + AnotherOpaqueType self, SseSerializer serializer); @protected void sse_encode_i_32(int self, SseSerializer serializer); @@ -161,28 +166,28 @@ class RustLibWire extends BaseWire { void wire_minimal_adder(NativePortType port_, int a, int b) => wasmModule.wire_minimal_adder(port_, a, b); - void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( dynamic ptr) => wasmModule - .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( ptr); - void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( dynamic ptr) => wasmModule - .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( ptr); - void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic ptr) => wasmModule - .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( ptr); - void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic ptr) => wasmModule - .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( ptr); } @@ -210,18 +215,18 @@ class RustLibWasmModule implements WasmModule { external void wire_minimal_adder(NativePortType port_, int a, int b); external void - rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( dynamic ptr); external void - rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( dynamic ptr); external void - rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic ptr); external void - rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic ptr); } diff --git a/frb_example/dart_minimal/rust/src/api/minimal.rs b/frb_example/dart_minimal/rust/src/api/minimal.rs index 57ae5e218d..4b81204ea1 100644 --- a/frb_example/dart_minimal/rust/src/api/minimal.rs +++ b/frb_example/dart_minimal/rust/src/api/minimal.rs @@ -10,17 +10,15 @@ pub fn minimal_adder(a: i32, b: i32) -> i32 { a + b } -#[frb(opaque)] -pub struct AnotherOpaqueType {} +use std::path::PathBuf; -#[frb(opaque)] -pub struct MyOpaqueType { - pub sad: AnotherOpaqueType, -} +pub struct MyOpaqueType(PathBuf); +pub struct AnotherOpaqueType(PathBuf); pub fn foo() -> (MyOpaqueType, AnotherOpaqueType) { todo!() } + pub fn bar() -> AnotherOpaqueType { todo!() } diff --git a/frb_example/dart_minimal/rust/src/frb_generated.io.rs b/frb_example/dart_minimal/rust/src/frb_generated.io.rs index a771e01fc9..13d69d4861 100644 --- a/frb_example/dart_minimal/rust/src/frb_generated.io.rs +++ b/frb_example/dart_minimal/rust/src/frb_generated.io.rs @@ -11,20 +11,36 @@ use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: dart2rust -impl CstDecode>> - for *const std::ffi::c_void +impl + CstDecode< + flutter_rust_bridge::RustOpaque>, + > for *const std::ffi::c_void { - fn cst_decode(self) -> flutter_rust_bridge::RustOpaque> { + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque> + { unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } } } impl - CstDecode>> - for *const std::ffi::c_void + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::minimal::MyOpaqueType, + crate::api::minimal::AnotherOpaqueType, + )>, + >, + > for *const std::ffi::c_void { fn cst_decode( self, - ) -> flutter_rust_bridge::RustOpaque> { + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::minimal::MyOpaqueType, + crate::api::minimal::AnotherOpaqueType, + )>, + > { unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } } } @@ -76,45 +92,51 @@ pub extern "C" fn frbgen_frb_example_dart_minimal_wire_minimal_adder(port_: i64, } #[no_mangle] -pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( +pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( ptr: *const std::ffi::c_void, ) { unsafe { flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< - std::sync::RwLock, + std::sync::RwLock, >(ptr); } } #[no_mangle] -pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( +pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( ptr: *const std::ffi::c_void, ) { unsafe { flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< - std::sync::RwLock, + std::sync::RwLock, >(ptr); } } #[no_mangle] -pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( +pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( ptr: *const std::ffi::c_void, ) { unsafe { flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< - std::sync::RwLock<(MyOpaqueType, AnotherOpaqueType)>, + std::sync::RwLock<( + crate::api::minimal::MyOpaqueType, + crate::api::minimal::AnotherOpaqueType, + )>, >(ptr); } } #[no_mangle] -pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( +pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( ptr: *const std::ffi::c_void, ) { unsafe { flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< - std::sync::RwLock<(MyOpaqueType, AnotherOpaqueType)>, + std::sync::RwLock<( + crate::api::minimal::MyOpaqueType, + crate::api::minimal::AnotherOpaqueType, + )>, >(ptr); } } diff --git a/frb_example/dart_minimal/rust/src/frb_generated.rs b/frb_example/dart_minimal/rust/src/frb_generated.rs index 17633be31c..a30478aba9 100644 --- a/frb_example/dart_minimal/rust/src/frb_generated.rs +++ b/frb_example/dart_minimal/rust/src/frb_generated.rs @@ -124,7 +124,9 @@ impl CstDecode for usize { self } } -impl SseDecode for flutter_rust_bridge::RustOpaque> { +impl SseDecode + for flutter_rust_bridge::RustOpaque> +{ fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { let mut inner = ::sse_decode(deserializer); return unsafe { flutter_rust_bridge::for_generated::sse_decode_rust_opaque(inner) }; @@ -132,7 +134,12 @@ impl SseDecode for flutter_rust_bridge::RustOpaque> + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::minimal::MyOpaqueType, + crate::api::minimal::AnotherOpaqueType, + )>, + > { fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { let mut inner = ::sse_decode(deserializer); @@ -164,7 +171,9 @@ impl SseDecode for bool { // Section: rust2dart -impl SseEncode for flutter_rust_bridge::RustOpaque> { +impl SseEncode + for flutter_rust_bridge::RustOpaque> +{ fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { let (ptr, size) = self.sse_encode_raw(); ::sse_encode(ptr, serializer); @@ -173,7 +182,12 @@ impl SseEncode for flutter_rust_bridge::RustOpaque> + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::minimal::MyOpaqueType, + crate::api::minimal::AnotherOpaqueType, + )>, + > { fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { let (ptr, size) = self.sse_encode_raw(); diff --git a/frb_example/dart_minimal/rust/src/frb_generated.web.rs b/frb_example/dart_minimal/rust/src/frb_generated.web.rs index 34041d38c4..3fa0aa9fbb 100644 --- a/frb_example/dart_minimal/rust/src/frb_generated.web.rs +++ b/frb_example/dart_minimal/rust/src/frb_generated.web.rs @@ -21,20 +21,36 @@ where (!self.is_null() && !self.is_undefined()).then(|| self.cst_decode()) } } -impl CstDecode>> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue +impl + CstDecode< + flutter_rust_bridge::RustOpaque>, + > for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - fn cst_decode(self) -> flutter_rust_bridge::RustOpaque> { + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque> + { unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } } } impl - CstDecode>> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::minimal::MyOpaqueType, + crate::api::minimal::AnotherOpaqueType, + )>, + >, + > for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { fn cst_decode( self, - ) -> flutter_rust_bridge::RustOpaque> { + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::minimal::MyOpaqueType, + crate::api::minimal::AnotherOpaqueType, + )>, + > { unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } } } @@ -87,45 +103,51 @@ pub fn wire_minimal_adder(port_: flutter_rust_bridge::for_generated::MessagePort } #[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( +pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( ptr: *const std::ffi::c_void, ) { unsafe { flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< - std::sync::RwLock, + std::sync::RwLock, >(ptr); } } #[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockAnotherOpaqueType( +pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( ptr: *const std::ffi::c_void, ) { unsafe { flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< - std::sync::RwLock, + std::sync::RwLock, >(ptr); } } #[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( +pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( ptr: *const std::ffi::c_void, ) { unsafe { flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< - std::sync::RwLock<(MyOpaqueType, AnotherOpaqueType)>, + std::sync::RwLock<( + crate::api::minimal::MyOpaqueType, + crate::api::minimal::AnotherOpaqueType, + )>, >(ptr); } } #[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockMyOpaqueTypeAnotherOpaqueType( +pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( ptr: *const std::ffi::c_void, ) { unsafe { flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< - std::sync::RwLock<(MyOpaqueType, AnotherOpaqueType)>, + std::sync::RwLock<( + crate::api::minimal::MyOpaqueType, + crate::api::minimal::AnotherOpaqueType, + )>, >(ptr); } } From 8db732491a8eb69c1127160b655aee0b7c61f8b1 Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:13:40 +0800 Subject: [PATCH 04/17] feat: unit test --- .../generator/api_dart/spec_generator/info.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs b/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs index 2001d20452..6102f9cfe7 100644 --- a/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs +++ b/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs @@ -250,3 +250,15 @@ fn rust_type_to_dart_type(rust: &str, brief_name: bool) -> String { fn char_not_alphanumeric(c: char) -> bool { !c.is_alphanumeric() } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + pub fn test_rust_type_to_dart_type() { + assert_eq!(&rust_type_to_dart_type("SomeType", true), "SomeType"); + assert_eq!(&rust_type_to_dart_type("flutter_rust_bridge::RustOpaque>", true), "AnotherOpaqueType"); + assert_eq!(&rust_type_to_dart_type("flutter_rust_bridge::RustOpaque>", true), "MyOpaqueTypeAnotherOpaqueType"); + } +} From 5e212bf8558860a607530d44c083167283dac486 Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:18:04 +0800 Subject: [PATCH 05/17] feat: try to handle `::` --- .../library/codegen/generator/api_dart/spec_generator/info.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs b/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs index 6102f9cfe7..4e0e89d1db 100644 --- a/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs +++ b/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs @@ -234,11 +234,10 @@ impl<'a> ApiDartGeneratorInfoTrait for UnencodableApiDartGenerator<'a> { fn rust_type_to_dart_type(rust: &str, brief_name: bool) -> String { lazy_static! { - static ref OPAQUE_FILTER: Regex =Regex::new(r"(\bdyn|'static|\bDartSafe|\bAssertUnwindSafe|\+ (Send|Sync|UnwindSafe|RefUnwindSafe))\b").unwrap(); + static ref OPAQUE_FILTER: Regex =Regex::new(r"(\bdyn|'static|\bDartSafe|\bAssertUnwindSafe|\+ (Send|Sync|UnwindSafe|RefUnwindSafe))\b|([a-zA-Z0-9_]+::(?=\w))").unwrap(); static ref OPAQUE_BRIEF_NAME_FILTER: Regex =Regex::new(r"(\bRwLock)\b").unwrap(); } - let rust = rust.split("::").last().unwrap(); let mut rust = OPAQUE_FILTER.replace_all(rust, "").to_string(); if brief_name { rust = OPAQUE_BRIEF_NAME_FILTER.replace_all(&rust, "").to_string(); From 95d644e3a3bfd26dfa257eb7eef0dd90c8118276 Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:18:48 +0800 Subject: [PATCH 06/17] feat: more regex --- .../library/codegen/generator/api_dart/spec_generator/info.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs b/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs index 4e0e89d1db..2efd9333c0 100644 --- a/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs +++ b/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs @@ -234,7 +234,7 @@ impl<'a> ApiDartGeneratorInfoTrait for UnencodableApiDartGenerator<'a> { fn rust_type_to_dart_type(rust: &str, brief_name: bool) -> String { lazy_static! { - static ref OPAQUE_FILTER: Regex =Regex::new(r"(\bdyn|'static|\bDartSafe|\bAssertUnwindSafe|\+ (Send|Sync|UnwindSafe|RefUnwindSafe))\b|([a-zA-Z0-9_]+::(?=\w))").unwrap(); + static ref OPAQUE_FILTER: Regex =Regex::new(r"((\bdyn|'static|\bDartSafe|\bAssertUnwindSafe|\+ (Send|Sync|UnwindSafe|RefUnwindSafe))\b)|([a-zA-Z0-9_]+::)").unwrap(); static ref OPAQUE_BRIEF_NAME_FILTER: Regex =Regex::new(r"(\bRwLock)\b").unwrap(); } From 7cd6eb8e2d06c960d88819d847421cc4011a9acb Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:19:13 +0800 Subject: [PATCH 07/17] fix: test --- .../codegen/generator/api_dart/spec_generator/info.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs b/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs index 2efd9333c0..5ea82ed2fc 100644 --- a/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs +++ b/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs @@ -257,7 +257,13 @@ mod tests { #[test] pub fn test_rust_type_to_dart_type() { assert_eq!(&rust_type_to_dart_type("SomeType", true), "SomeType"); - assert_eq!(&rust_type_to_dart_type("flutter_rust_bridge::RustOpaque>", true), "AnotherOpaqueType"); - assert_eq!(&rust_type_to_dart_type("flutter_rust_bridge::RustOpaque>", true), "MyOpaqueTypeAnotherOpaqueType"); + assert_eq!( + &rust_type_to_dart_type( + "std::sync::RwLock", + true + ), + "AnotherOpaqueType" + ); + assert_eq!(&rust_type_to_dart_type("std::sync::RwLock<(crate::api::simple::MyOpaqueType,crate::api::simple::AnotherOpaqueType,)>", true), "MyOpaqueTypeAnotherOpaqueType"); } } From 44487c65b8b133063f58d913f741b9989a62176f Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:19:37 +0800 Subject: [PATCH 08/17] chore: codegen --- .../lib/src/rust/api/minimal.dart | 20 +++++----- .../lib/src/rust/frb_generated.dart | 38 +++++++++---------- .../lib/src/rust/frb_generated.io.dart | 18 ++++----- .../lib/src/rust/frb_generated.web.dart | 18 ++++----- 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/frb_example/dart_minimal/lib/src/rust/api/minimal.dart b/frb_example/dart_minimal/lib/src/rust/api/minimal.dart index 84ee41b454..bf22351de6 100644 --- a/frb_example/dart_minimal/lib/src/rust/api/minimal.dart +++ b/frb_example/dart_minimal/lib/src/rust/api/minimal.dart @@ -9,7 +9,7 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; Future minimalAdder({required int a, required int b, dynamic hint}) => RustLib.instance.api.minimalAdder(a: a, b: b, hint: hint); -Future foo({dynamic hint}) => +Future foo({dynamic hint}) => RustLib.instance.api.foo(hint: hint); Future bar({dynamic hint}) => @@ -36,19 +36,19 @@ class AnotherOpaqueType extends RustOpaque { // Rust type: flutter_rust_bridge::RustOpaque> @sealed -class AnotherOpaqueType extends RustOpaque { - AnotherOpaqueType.dcoDecode(List wire) +class MyOpaqueTypeAnotherOpaqueType extends RustOpaque { + MyOpaqueTypeAnotherOpaqueType.dcoDecode(List wire) : super.dcoDecode(wire, _kStaticData); - AnotherOpaqueType.sseDecode(int ptr, int externalSizeOnNative) + MyOpaqueTypeAnotherOpaqueType.sseDecode(int ptr, int externalSizeOnNative) : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); static final _kStaticData = RustArcStaticData( - rustArcIncrementStrongCount: - RustLib.instance.api.rust_arc_increment_strong_count_AnotherOpaqueType, - rustArcDecrementStrongCount: - RustLib.instance.api.rust_arc_decrement_strong_count_AnotherOpaqueType, - rustArcDecrementStrongCountPtr: RustLib - .instance.api.rust_arc_decrement_strong_count_AnotherOpaqueTypePtr, + rustArcIncrementStrongCount: RustLib.instance.api + .rust_arc_increment_strong_count_MyOpaqueTypeAnotherOpaqueType, + rustArcDecrementStrongCount: RustLib.instance.api + .rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueType, + rustArcDecrementStrongCountPtr: RustLib.instance.api + .rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr, ); } diff --git a/frb_example/dart_minimal/lib/src/rust/frb_generated.dart b/frb_example/dart_minimal/lib/src/rust/frb_generated.dart index 31ab5d5dba..b3567b7fa9 100644 --- a/frb_example/dart_minimal/lib/src/rust/frb_generated.dart +++ b/frb_example/dart_minimal/lib/src/rust/frb_generated.dart @@ -63,7 +63,7 @@ class RustLib extends BaseEntrypoint { abstract class RustLibApi extends BaseApi { Future bar({dynamic hint}); - Future foo({dynamic hint}); + Future foo({dynamic hint}); Future initApp({dynamic hint}); @@ -79,13 +79,13 @@ abstract class RustLibApi extends BaseApi { get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_AnotherOpaqueType; + get rust_arc_increment_strong_count_MyOpaqueTypeAnotherOpaqueType; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_AnotherOpaqueType; + get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueType; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr; + get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr; } class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @@ -120,7 +120,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future foo({dynamic hint}) { + Future foo({dynamic hint}) { return handler.executeNormal(NormalTask( callFfi: (port_) { return wire.wire_foo(port_); @@ -197,11 +197,11 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType; RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_AnotherOpaqueType => wire + get rust_arc_increment_strong_count_MyOpaqueTypeAnotherOpaqueType => wire .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType; RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_AnotherOpaqueType => wire + get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueType => wire .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType; @protected @@ -212,10 +212,10 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } @protected - AnotherOpaqueType + MyOpaqueTypeAnotherOpaqueType dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic raw) { - return AnotherOpaqueType.dcoDecode(raw as List); + return MyOpaqueTypeAnotherOpaqueType.dcoDecode(raw as List); } @protected @@ -226,10 +226,10 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } @protected - AnotherOpaqueType + MyOpaqueTypeAnotherOpaqueType dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic raw) { - return AnotherOpaqueType.dcoDecode(raw as List); + return MyOpaqueTypeAnotherOpaqueType.dcoDecode(raw as List); } @protected @@ -256,10 +256,10 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } @protected - AnotherOpaqueType + MyOpaqueTypeAnotherOpaqueType sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( SseDeserializer deserializer) { - return AnotherOpaqueType.sseDecode( + return MyOpaqueTypeAnotherOpaqueType.sseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @@ -272,10 +272,10 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } @protected - AnotherOpaqueType + MyOpaqueTypeAnotherOpaqueType sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( SseDeserializer deserializer) { - return AnotherOpaqueType.sseDecode( + return MyOpaqueTypeAnotherOpaqueType.sseDecode( sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @@ -308,7 +308,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected PlatformPointer cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - AnotherOpaqueType raw) { + MyOpaqueTypeAnotherOpaqueType raw) { // ignore: invalid_use_of_internal_member return raw.cstEncode(move: true); } @@ -324,7 +324,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected PlatformPointer cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - AnotherOpaqueType raw) { + MyOpaqueTypeAnotherOpaqueType raw) { // ignore: invalid_use_of_internal_member return raw.cstEncode(); } @@ -354,7 +354,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer) { + MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer) { sse_encode_usize(self.sseEncode(move: true), serializer); } @@ -367,7 +367,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer) { + MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer) { sse_encode_usize(self.sseEncode(move: null), serializer); } diff --git a/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart b/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart index bc956b24a0..023e08480c 100644 --- a/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart +++ b/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart @@ -23,7 +23,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { ._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueTypePtr; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr => wire + get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr => wire ._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueTypePtr; @protected @@ -32,7 +32,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { dynamic raw); @protected - AnotherOpaqueType + MyOpaqueTypeAnotherOpaqueType dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic raw); @@ -42,7 +42,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { dynamic raw); @protected - AnotherOpaqueType + MyOpaqueTypeAnotherOpaqueType dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic raw); @@ -61,7 +61,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { SseDeserializer deserializer); @protected - AnotherOpaqueType + MyOpaqueTypeAnotherOpaqueType sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( SseDeserializer deserializer); @@ -71,7 +71,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { SseDeserializer deserializer); @protected - AnotherOpaqueType + MyOpaqueTypeAnotherOpaqueType sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( SseDeserializer deserializer); @@ -95,7 +95,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected PlatformPointer cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - AnotherOpaqueType raw); + MyOpaqueTypeAnotherOpaqueType raw); @protected PlatformPointer @@ -105,7 +105,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected PlatformPointer cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - AnotherOpaqueType raw); + MyOpaqueTypeAnotherOpaqueType raw); @protected int cst_encode_i_32(int raw); @@ -124,7 +124,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer); + MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); @protected void sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( @@ -133,7 +133,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer); + MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); @protected void sse_encode_i_32(int self, SseSerializer serializer); diff --git a/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart b/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart index 10237f96ef..be99254aac 100644 --- a/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart +++ b/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart @@ -22,7 +22,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType; CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr => wire + get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr => wire .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType; @protected @@ -31,7 +31,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { dynamic raw); @protected - AnotherOpaqueType + MyOpaqueTypeAnotherOpaqueType dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic raw); @@ -41,7 +41,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { dynamic raw); @protected - AnotherOpaqueType + MyOpaqueTypeAnotherOpaqueType dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( dynamic raw); @@ -60,7 +60,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { SseDeserializer deserializer); @protected - AnotherOpaqueType + MyOpaqueTypeAnotherOpaqueType sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( SseDeserializer deserializer); @@ -70,7 +70,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { SseDeserializer deserializer); @protected - AnotherOpaqueType + MyOpaqueTypeAnotherOpaqueType sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( SseDeserializer deserializer); @@ -94,7 +94,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected PlatformPointer cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - AnotherOpaqueType raw); + MyOpaqueTypeAnotherOpaqueType raw); @protected PlatformPointer @@ -104,7 +104,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected PlatformPointer cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - AnotherOpaqueType raw); + MyOpaqueTypeAnotherOpaqueType raw); @protected int cst_encode_i_32(int raw); @@ -123,7 +123,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer); + MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); @protected void sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( @@ -132,7 +132,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer); + MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); @protected void sse_encode_i_32(int self, SseSerializer serializer); From 862384aa826dece2e971629b318281bfe5c33be2 Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:22:08 +0800 Subject: [PATCH 09/17] feat: add to pure_dart test --- frb_example/dart_minimal/rust/src/api/minimal.rs | 13 ------------- .../pure_dart/rust/src/api/rust_auto_opaque.rs | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/frb_example/dart_minimal/rust/src/api/minimal.rs b/frb_example/dart_minimal/rust/src/api/minimal.rs index 4b81204ea1..525e7e0774 100644 --- a/frb_example/dart_minimal/rust/src/api/minimal.rs +++ b/frb_example/dart_minimal/rust/src/api/minimal.rs @@ -9,16 +9,3 @@ pub fn init_app() { pub fn minimal_adder(a: i32, b: i32) -> i32 { a + b } - -use std::path::PathBuf; - -pub struct MyOpaqueType(PathBuf); -pub struct AnotherOpaqueType(PathBuf); - -pub fn foo() -> (MyOpaqueType, AnotherOpaqueType) { - todo!() -} - -pub fn bar() -> AnotherOpaqueType { - todo!() -} diff --git a/frb_example/pure_dart/rust/src/api/rust_auto_opaque.rs b/frb_example/pure_dart/rust/src/api/rust_auto_opaque.rs index 529e4ca054..9e294bc684 100644 --- a/frb_example/pure_dart/rust/src/api/rust_auto_opaque.rs +++ b/frb_example/pure_dart/rust/src/api/rust_auto_opaque.rs @@ -1,6 +1,7 @@ // FRB_INTERNAL_GENERATOR: {"forbiddenDuplicatorModes": ["rustAsync", "rustAsyncSse"]} use flutter_rust_bridge::frb; +use std::path::PathBuf; // TODO auto determine it is opaque or not later #[frb(opaque)] @@ -236,3 +237,16 @@ pub fn rust_auto_opaque_struct_with_good_and_opaque_field_return_own_twin_normal opaque: NonCloneSimpleTwinNormal { inner: 42 }, } } + +// ================ misc =================== + +// #1577 - this should generate valid Dart code without name collisions +pub struct OpaqueOneTwinNormal(PathBuf); +pub struct OpaqueTwoTwinNormal(PathBuf); +pub fn rust_auto_opaque_return_opaque_one_and_two_twin_normal( +) -> (OpaqueOneTwinNormal, OpaqueTwoTwinNormal) { + unimplemented!() +} +pub fn rust_auto_opaque_return_opaque_two_twin_normal() -> OpaqueTwoTwinNormal { + unimplemented!() +} From 05a4d39699f5383c49120c525243c42fb8396626 Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:22:41 +0800 Subject: [PATCH 10/17] chore: codegen --- frb_example/dart_minimal/frb_generated.h | 18 -- .../lib/src/rust/api/minimal.dart | 44 ---- .../lib/src/rust/frb_generated.dart | 223 ------------------ .../lib/src/rust/frb_generated.io.dart | 189 --------------- .../lib/src/rust/frb_generated.web.dart | 147 ------------ .../dart_minimal/rust/src/frb_generated.io.rs | 94 -------- .../dart_minimal/rust/src/frb_generated.rs | 109 --------- .../rust/src/frb_generated.web.rs | 99 -------- .../rust_auto_opaque_twin_sse.rs | 16 ++ .../rust_auto_opaque_twin_sync.rs | 16 ++ .../rust_auto_opaque_twin_sync_sse.rs | 18 ++ 11 files changed, 50 insertions(+), 923 deletions(-) diff --git a/frb_example/dart_minimal/frb_generated.h b/frb_example/dart_minimal/frb_generated.h index 94a4d0c877..629f100abe 100644 --- a/frb_example/dart_minimal/frb_generated.h +++ b/frb_example/dart_minimal/frb_generated.h @@ -15,31 +15,13 @@ void frbgen_frb_example_dart_minimal_dart_fn_deliver_output(int32_t call_id, int32_t rust_vec_len_, int32_t data_len_); -void frbgen_frb_example_dart_minimal_wire_bar(int64_t port_); - -void frbgen_frb_example_dart_minimal_wire_foo(int64_t port_); - void frbgen_frb_example_dart_minimal_wire_init_app(int64_t port_); void frbgen_frb_example_dart_minimal_wire_minimal_adder(int64_t port_, int32_t a, int32_t b); - -void frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType(const void *ptr); - -void frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType(const void *ptr); - -void frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType(const void *ptr); - -void frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType(const void *ptr); static int64_t dummy_method_to_enforce_bundling(void) { int64_t dummy_var = 0; dummy_var ^= ((int64_t) (void*) drop_dart_object); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_dart_fn_deliver_output); - dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType); - dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType); - dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType); - dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType); - dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_wire_bar); - dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_wire_foo); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_wire_init_app); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_dart_minimal_wire_minimal_adder); dummy_var ^= ((int64_t) (void*) get_dart_object); diff --git a/frb_example/dart_minimal/lib/src/rust/api/minimal.dart b/frb_example/dart_minimal/lib/src/rust/api/minimal.dart index bf22351de6..ed41dd7399 100644 --- a/frb_example/dart_minimal/lib/src/rust/api/minimal.dart +++ b/frb_example/dart_minimal/lib/src/rust/api/minimal.dart @@ -8,47 +8,3 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; Future minimalAdder({required int a, required int b, dynamic hint}) => RustLib.instance.api.minimalAdder(a: a, b: b, hint: hint); - -Future foo({dynamic hint}) => - RustLib.instance.api.foo(hint: hint); - -Future bar({dynamic hint}) => - RustLib.instance.api.bar(hint: hint); - -// Rust type: flutter_rust_bridge::RustOpaque> -@sealed -class AnotherOpaqueType extends RustOpaque { - AnotherOpaqueType.dcoDecode(List wire) - : super.dcoDecode(wire, _kStaticData); - - AnotherOpaqueType.sseDecode(int ptr, int externalSizeOnNative) - : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); - - static final _kStaticData = RustArcStaticData( - rustArcIncrementStrongCount: - RustLib.instance.api.rust_arc_increment_strong_count_AnotherOpaqueType, - rustArcDecrementStrongCount: - RustLib.instance.api.rust_arc_decrement_strong_count_AnotherOpaqueType, - rustArcDecrementStrongCountPtr: RustLib - .instance.api.rust_arc_decrement_strong_count_AnotherOpaqueTypePtr, - ); -} - -// Rust type: flutter_rust_bridge::RustOpaque> -@sealed -class MyOpaqueTypeAnotherOpaqueType extends RustOpaque { - MyOpaqueTypeAnotherOpaqueType.dcoDecode(List wire) - : super.dcoDecode(wire, _kStaticData); - - MyOpaqueTypeAnotherOpaqueType.sseDecode(int ptr, int externalSizeOnNative) - : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); - - static final _kStaticData = RustArcStaticData( - rustArcIncrementStrongCount: RustLib.instance.api - .rust_arc_increment_strong_count_MyOpaqueTypeAnotherOpaqueType, - rustArcDecrementStrongCount: RustLib.instance.api - .rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueType, - rustArcDecrementStrongCountPtr: RustLib.instance.api - .rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr, - ); -} diff --git a/frb_example/dart_minimal/lib/src/rust/frb_generated.dart b/frb_example/dart_minimal/lib/src/rust/frb_generated.dart index b3567b7fa9..12cb9f6886 100644 --- a/frb_example/dart_minimal/lib/src/rust/frb_generated.dart +++ b/frb_example/dart_minimal/lib/src/rust/frb_generated.dart @@ -61,31 +61,9 @@ class RustLib extends BaseEntrypoint { } abstract class RustLibApi extends BaseApi { - Future bar({dynamic hint}); - - Future foo({dynamic hint}); - Future initApp({dynamic hint}); Future minimalAdder({required int a, required int b, dynamic hint}); - - RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_AnotherOpaqueType; - - RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_AnotherOpaqueType; - - CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr; - - RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_MyOpaqueTypeAnotherOpaqueType; - - RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueType; - - CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr; } class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @@ -96,52 +74,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { required super.portManager, }); - @override - Future bar({dynamic hint}) { - return handler.executeNormal(NormalTask( - callFfi: (port_) { - return wire.wire_bar(port_); - }, - codec: DcoCodec( - decodeSuccessData: - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType, - decodeErrorData: null, - ), - constMeta: kBarConstMeta, - argValues: [], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kBarConstMeta => const TaskConstMeta( - debugName: "bar", - argNames: [], - ); - - @override - Future foo({dynamic hint}) { - return handler.executeNormal(NormalTask( - callFfi: (port_) { - return wire.wire_foo(port_); - }, - codec: DcoCodec( - decodeSuccessData: - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType, - decodeErrorData: null, - ), - constMeta: kFooConstMeta, - argValues: [], - apiImpl: this, - hint: hint, - )); - } - - TaskConstMeta get kFooConstMeta => const TaskConstMeta( - debugName: "foo", - argNames: [], - ); - @override Future initApp({dynamic hint}) { return handler.executeNormal(NormalTask( @@ -188,50 +120,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: ["a", "b"], ); - RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_AnotherOpaqueType => wire - .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType; - - RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_AnotherOpaqueType => wire - .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType; - - RustArcIncrementStrongCountFnType - get rust_arc_increment_strong_count_MyOpaqueTypeAnotherOpaqueType => wire - .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType; - - RustArcDecrementStrongCountFnType - get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueType => wire - .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType; - - @protected - AnotherOpaqueType - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - dynamic raw) { - return AnotherOpaqueType.dcoDecode(raw as List); - } - - @protected - MyOpaqueTypeAnotherOpaqueType - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - dynamic raw) { - return MyOpaqueTypeAnotherOpaqueType.dcoDecode(raw as List); - } - - @protected - AnotherOpaqueType - dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - dynamic raw) { - return AnotherOpaqueType.dcoDecode(raw as List); - } - - @protected - MyOpaqueTypeAnotherOpaqueType - dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - dynamic raw) { - return MyOpaqueTypeAnotherOpaqueType.dcoDecode(raw as List); - } - @protected int dco_decode_i_32(dynamic raw) { return raw as int; @@ -242,43 +130,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return; } - @protected - int dco_decode_usize(dynamic raw) { - return dcoDecodeI64OrU64(raw); - } - - @protected - AnotherOpaqueType - sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - SseDeserializer deserializer) { - return AnotherOpaqueType.sseDecode( - sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); - } - - @protected - MyOpaqueTypeAnotherOpaqueType - sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - SseDeserializer deserializer) { - return MyOpaqueTypeAnotherOpaqueType.sseDecode( - sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); - } - - @protected - AnotherOpaqueType - sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - SseDeserializer deserializer) { - return AnotherOpaqueType.sseDecode( - sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); - } - - @protected - MyOpaqueTypeAnotherOpaqueType - sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - SseDeserializer deserializer) { - return MyOpaqueTypeAnotherOpaqueType.sseDecode( - sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); - } - @protected int sse_decode_i_32(SseDeserializer deserializer) { return deserializer.buffer.getInt32(); @@ -287,48 +138,11 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_decode_unit(SseDeserializer deserializer) {} - @protected - int sse_decode_usize(SseDeserializer deserializer) { - return deserializer.buffer.getUint64(); - } - @protected bool sse_decode_bool(SseDeserializer deserializer) { return deserializer.buffer.getUint8() != 0; } - @protected - PlatformPointer - cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - AnotherOpaqueType raw) { - // ignore: invalid_use_of_internal_member - return raw.cstEncode(move: true); - } - - @protected - PlatformPointer - cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType raw) { - // ignore: invalid_use_of_internal_member - return raw.cstEncode(move: true); - } - - @protected - PlatformPointer - cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - AnotherOpaqueType raw) { - // ignore: invalid_use_of_internal_member - return raw.cstEncode(); - } - - @protected - PlatformPointer - cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType raw) { - // ignore: invalid_use_of_internal_member - return raw.cstEncode(); - } - @protected int cst_encode_i_32(int raw) { return raw; @@ -339,38 +153,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return raw; } - @protected - int cst_encode_usize(int raw) { - return raw; - } - - @protected - void - sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer) { - sse_encode_usize(self.sseEncode(move: true), serializer); - } - - @protected - void - sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer) { - sse_encode_usize(self.sseEncode(move: true), serializer); - } - - @protected - void sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer) { - sse_encode_usize(self.sseEncode(move: null), serializer); - } - - @protected - void - sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer) { - sse_encode_usize(self.sseEncode(move: null), serializer); - } - @protected void sse_encode_i_32(int self, SseSerializer serializer) { serializer.buffer.putInt32(self); @@ -379,11 +161,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @protected void sse_encode_unit(void self, SseSerializer serializer) {} - @protected - void sse_encode_usize(int self, SseSerializer serializer) { - serializer.buffer.putUint64(self); - } - @protected void sse_encode_bool(bool self, SseSerializer serializer) { serializer.buffer.putUint8(self ? 1 : 0); diff --git a/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart b/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart index 023e08480c..78103e6aeb 100644 --- a/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart +++ b/frb_example/dart_minimal/lib/src/rust/frb_generated.io.dart @@ -18,132 +18,33 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { required super.portManager, }); - CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr => wire - ._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueTypePtr; - - CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr => wire - ._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueTypePtr; - - @protected - AnotherOpaqueType - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - dynamic raw); - - @protected - MyOpaqueTypeAnotherOpaqueType - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - dynamic raw); - - @protected - AnotherOpaqueType - dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - dynamic raw); - - @protected - MyOpaqueTypeAnotherOpaqueType - dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - dynamic raw); - @protected int dco_decode_i_32(dynamic raw); @protected void dco_decode_unit(dynamic raw); - @protected - int dco_decode_usize(dynamic raw); - - @protected - AnotherOpaqueType - sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - SseDeserializer deserializer); - - @protected - MyOpaqueTypeAnotherOpaqueType - sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - SseDeserializer deserializer); - - @protected - AnotherOpaqueType - sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - SseDeserializer deserializer); - - @protected - MyOpaqueTypeAnotherOpaqueType - sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - SseDeserializer deserializer); - @protected int sse_decode_i_32(SseDeserializer deserializer); @protected void sse_decode_unit(SseDeserializer deserializer); - @protected - int sse_decode_usize(SseDeserializer deserializer); - @protected bool sse_decode_bool(SseDeserializer deserializer); - @protected - PlatformPointer - cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - AnotherOpaqueType raw); - - @protected - PlatformPointer - cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType raw); - - @protected - PlatformPointer - cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - AnotherOpaqueType raw); - - @protected - PlatformPointer - cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType raw); - @protected int cst_encode_i_32(int raw); @protected void cst_encode_unit(void raw); - @protected - int cst_encode_usize(int raw); - - @protected - void - sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer); - - @protected - void - sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); - - @protected - void sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer); - - @protected - void - sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); - @protected void sse_encode_i_32(int self, SseSerializer serializer); @protected void sse_encode_unit(void self, SseSerializer serializer); - @protected - void sse_encode_usize(int self, SseSerializer serializer); - @protected void sse_encode_bool(bool self, SseSerializer serializer); } @@ -197,32 +98,6 @@ class RustLibWire implements BaseWire { late final _dart_fn_deliver_output = _dart_fn_deliver_outputPtr .asFunction, int, int)>(); - void wire_bar( - int port_, - ) { - return _wire_bar( - port_, - ); - } - - late final _wire_barPtr = - _lookup>( - 'frbgen_frb_example_dart_minimal_wire_bar'); - late final _wire_bar = _wire_barPtr.asFunction(); - - void wire_foo( - int port_, - ) { - return _wire_foo( - port_, - ); - } - - late final _wire_fooPtr = - _lookup>( - 'frbgen_frb_example_dart_minimal_wire_foo'); - late final _wire_foo = _wire_fooPtr.asFunction(); - void wire_init_app( int port_, ) { @@ -256,70 +131,6 @@ class RustLibWire implements BaseWire { late final _wire_minimal_adder = _wire_minimal_adderPtr.asFunction(); - void - rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - ffi.Pointer ptr, - ) { - return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - ptr, - ); - } - - late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueTypePtr = - _lookup)>>( - 'frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType'); - late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType = - _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueTypePtr - .asFunction)>(); - - void - rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - ffi.Pointer ptr, - ) { - return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - ptr, - ); - } - - late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueTypePtr = - _lookup)>>( - 'frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType'); - late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType = - _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueTypePtr - .asFunction)>(); - - void - rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - ffi.Pointer ptr, - ) { - return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - ptr, - ); - } - - late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueTypePtr = - _lookup)>>( - 'frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType'); - late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType = - _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueTypePtr - .asFunction)>(); - - void - rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - ffi.Pointer ptr, - ) { - return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - ptr, - ); - } - - late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueTypePtr = - _lookup)>>( - 'frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType'); - late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType = - _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueTypePtr - .asFunction)>(); - int dummy_method_to_enforce_bundling() { return _dummy_method_to_enforce_bundling(); } diff --git a/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart b/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart index be99254aac..20690d5bd7 100644 --- a/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart +++ b/frb_example/dart_minimal/lib/src/rust/frb_generated.web.dart @@ -17,132 +17,33 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { required super.portManager, }); - CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_AnotherOpaqueTypePtr => wire - .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType; - - CrossPlatformFinalizerArg - get rust_arc_decrement_strong_count_MyOpaqueTypeAnotherOpaqueTypePtr => wire - .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType; - - @protected - AnotherOpaqueType - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - dynamic raw); - - @protected - MyOpaqueTypeAnotherOpaqueType - dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - dynamic raw); - - @protected - AnotherOpaqueType - dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - dynamic raw); - - @protected - MyOpaqueTypeAnotherOpaqueType - dco_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - dynamic raw); - @protected int dco_decode_i_32(dynamic raw); @protected void dco_decode_unit(dynamic raw); - @protected - int dco_decode_usize(dynamic raw); - - @protected - AnotherOpaqueType - sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - SseDeserializer deserializer); - - @protected - MyOpaqueTypeAnotherOpaqueType - sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - SseDeserializer deserializer); - - @protected - AnotherOpaqueType - sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - SseDeserializer deserializer); - - @protected - MyOpaqueTypeAnotherOpaqueType - sse_decode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - SseDeserializer deserializer); - @protected int sse_decode_i_32(SseDeserializer deserializer); @protected void sse_decode_unit(SseDeserializer deserializer); - @protected - int sse_decode_usize(SseDeserializer deserializer); - @protected bool sse_decode_bool(SseDeserializer deserializer); - @protected - PlatformPointer - cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - AnotherOpaqueType raw); - - @protected - PlatformPointer - cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType raw); - - @protected - PlatformPointer - cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - AnotherOpaqueType raw); - - @protected - PlatformPointer - cst_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType raw); - @protected int cst_encode_i_32(int raw); @protected void cst_encode_unit(void raw); - @protected - int cst_encode_usize(int raw); - - @protected - void - sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer); - - @protected - void - sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); - - @protected - void sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - AnotherOpaqueType self, SseSerializer serializer); - - @protected - void - sse_encode_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - MyOpaqueTypeAnotherOpaqueType self, SseSerializer serializer); - @protected void sse_encode_i_32(int self, SseSerializer serializer); @protected void sse_encode_unit(void self, SseSerializer serializer); - @protected - void sse_encode_usize(int self, SseSerializer serializer); - @protected void sse_encode_bool(bool self, SseSerializer serializer); } @@ -157,38 +58,10 @@ class RustLibWire extends BaseWire { wasmModule.dart_fn_deliver_output( call_id, ptr_, rust_vec_len_, data_len_); - void wire_bar(NativePortType port_) => wasmModule.wire_bar(port_); - - void wire_foo(NativePortType port_) => wasmModule.wire_foo(port_); - void wire_init_app(NativePortType port_) => wasmModule.wire_init_app(port_); void wire_minimal_adder(NativePortType port_, int a, int b) => wasmModule.wire_minimal_adder(port_, a, b); - - void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - dynamic ptr) => - wasmModule - .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - ptr); - - void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - dynamic ptr) => - wasmModule - .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - ptr); - - void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - dynamic ptr) => - wasmModule - .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - ptr); - - void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - dynamic ptr) => - wasmModule - .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - ptr); } @JS('wasm_bindgen') @@ -206,27 +79,7 @@ class RustLibWasmModule implements WasmModule { external void dart_fn_deliver_output(int call_id, PlatformGeneralizedUint8ListPtr ptr_, int rust_vec_len_, int data_len_); - external void wire_bar(NativePortType port_); - - external void wire_foo(NativePortType port_); - external void wire_init_app(NativePortType port_); external void wire_minimal_adder(NativePortType port_, int a, int b); - - external void - rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - dynamic ptr); - - external void - rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - dynamic ptr); - - external void - rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - dynamic ptr); - - external void - rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - dynamic ptr); } diff --git a/frb_example/dart_minimal/rust/src/frb_generated.io.rs b/frb_example/dart_minimal/rust/src/frb_generated.io.rs index 13d69d4861..038fdee752 100644 --- a/frb_example/dart_minimal/rust/src/frb_generated.io.rs +++ b/frb_example/dart_minimal/rust/src/frb_generated.io.rs @@ -4,46 +4,12 @@ // Section: imports use super::*; -use crate::api::minimal::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; use flutter_rust_bridge::for_generated::transform_result_dco; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: dart2rust -impl - CstDecode< - flutter_rust_bridge::RustOpaque>, - > for *const std::ffi::c_void -{ - fn cst_decode( - self, - ) -> flutter_rust_bridge::RustOpaque> - { - unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } - } -} -impl - CstDecode< - flutter_rust_bridge::RustOpaque< - std::sync::RwLock<( - crate::api::minimal::MyOpaqueType, - crate::api::minimal::AnotherOpaqueType, - )>, - >, - > for *const std::ffi::c_void -{ - fn cst_decode( - self, - ) -> flutter_rust_bridge::RustOpaque< - std::sync::RwLock<( - crate::api::minimal::MyOpaqueType, - crate::api::minimal::AnotherOpaqueType, - )>, - > { - unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } - } -} pub trait NewWithNullPtr { fn new_with_null_ptr() -> Self; } @@ -71,16 +37,6 @@ pub extern "C" fn frbgen_frb_example_dart_minimal_dart_fn_deliver_output( FLUTTER_RUST_BRIDGE_HANDLER.dart_fn_handle_output(call_id, message) } -#[no_mangle] -pub extern "C" fn frbgen_frb_example_dart_minimal_wire_bar(port_: i64) { - wire_bar_impl(port_) -} - -#[no_mangle] -pub extern "C" fn frbgen_frb_example_dart_minimal_wire_foo(port_: i64) { - wire_foo_impl(port_) -} - #[no_mangle] pub extern "C" fn frbgen_frb_example_dart_minimal_wire_init_app(port_: i64) { wire_init_app_impl(port_) @@ -90,53 +46,3 @@ pub extern "C" fn frbgen_frb_example_dart_minimal_wire_init_app(port_: i64) { pub extern "C" fn frbgen_frb_example_dart_minimal_wire_minimal_adder(port_: i64, a: i32, b: i32) { wire_minimal_adder_impl(port_, a, b) } - -#[no_mangle] -pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - ptr: *const std::ffi::c_void, -) { - unsafe { - flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< - std::sync::RwLock, - >(ptr); - } -} - -#[no_mangle] -pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - ptr: *const std::ffi::c_void, -) { - unsafe { - flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< - std::sync::RwLock, - >(ptr); - } -} - -#[no_mangle] -pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - ptr: *const std::ffi::c_void, -) { - unsafe { - flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< - std::sync::RwLock<( - crate::api::minimal::MyOpaqueType, - crate::api::minimal::AnotherOpaqueType, - )>, - >(ptr); - } -} - -#[no_mangle] -pub extern "C" fn frbgen_frb_example_dart_minimal_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - ptr: *const std::ffi::c_void, -) { - unsafe { - flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< - std::sync::RwLock<( - crate::api::minimal::MyOpaqueType, - crate::api::minimal::AnotherOpaqueType, - )>, - >(ptr); - } -} diff --git a/frb_example/dart_minimal/rust/src/frb_generated.rs b/frb_example/dart_minimal/rust/src/frb_generated.rs index a30478aba9..b3e77e7421 100644 --- a/frb_example/dart_minimal/rust/src/frb_generated.rs +++ b/frb_example/dart_minimal/rust/src/frb_generated.rs @@ -18,7 +18,6 @@ // Section: imports -use crate::api::minimal::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; use flutter_rust_bridge::for_generated::transform_result_dco; use flutter_rust_bridge::{Handler, IntoIntoDart}; @@ -33,46 +32,6 @@ flutter_rust_bridge::frb_generated_default_handler!(); // Section: wire_funcs -fn wire_bar_impl(port_: flutter_rust_bridge::for_generated::MessagePort) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( - flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "bar", - port: Some(port_), - mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, - }, - move || { - move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok( - flutter_rust_bridge::for_generated::rust_auto_opaque_encode( - crate::api::minimal::bar(), - ), - ) - })()) - } - }, - ) -} -fn wire_foo_impl(port_: flutter_rust_bridge::for_generated::MessagePort) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( - flutter_rust_bridge::for_generated::TaskInfo { - debug_name: "foo", - port: Some(port_), - mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, - }, - move || { - move |context| { - transform_result_dco((move || { - Result::<_, ()>::Ok( - flutter_rust_bridge::for_generated::rust_auto_opaque_encode( - crate::api::minimal::foo(), - ), - ) - })()) - } - }, - ) -} fn wire_init_app_impl(port_: flutter_rust_bridge::for_generated::MessagePort) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( flutter_rust_bridge::for_generated::TaskInfo { @@ -119,34 +78,6 @@ impl CstDecode for i32 { self } } -impl CstDecode for usize { - fn cst_decode(self) -> usize { - self - } -} -impl SseDecode - for flutter_rust_bridge::RustOpaque> -{ - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut inner = ::sse_decode(deserializer); - return unsafe { flutter_rust_bridge::for_generated::sse_decode_rust_opaque(inner) }; - } -} - -impl SseDecode - for flutter_rust_bridge::RustOpaque< - std::sync::RwLock<( - crate::api::minimal::MyOpaqueType, - crate::api::minimal::AnotherOpaqueType, - )>, - > -{ - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut inner = ::sse_decode(deserializer); - return unsafe { flutter_rust_bridge::for_generated::sse_decode_rust_opaque(inner) }; - } -} - impl SseDecode for i32 { fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { deserializer.cursor.read_i32::().unwrap() @@ -157,12 +88,6 @@ impl SseDecode for () { fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {} } -impl SseDecode for usize { - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - deserializer.cursor.read_u64::().unwrap() as _ - } -} - impl SseDecode for bool { fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { deserializer.cursor.read_u8().unwrap() != 0 @@ -171,31 +96,6 @@ impl SseDecode for bool { // Section: rust2dart -impl SseEncode - for flutter_rust_bridge::RustOpaque> -{ - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - let (ptr, size) = self.sse_encode_raw(); - ::sse_encode(ptr, serializer); - ::sse_encode(size, serializer); - } -} - -impl SseEncode - for flutter_rust_bridge::RustOpaque< - std::sync::RwLock<( - crate::api::minimal::MyOpaqueType, - crate::api::minimal::AnotherOpaqueType, - )>, - > -{ - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - let (ptr, size) = self.sse_encode_raw(); - ::sse_encode(ptr, serializer); - ::sse_encode(size, serializer); - } -} - impl SseEncode for i32 { fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { serializer.cursor.write_i32::(self).unwrap(); @@ -206,15 +106,6 @@ impl SseEncode for () { fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {} } -impl SseEncode for usize { - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - serializer - .cursor - .write_u64::(self as _) - .unwrap(); - } -} - impl SseEncode for bool { fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { serializer.cursor.write_u8(self as _).unwrap(); diff --git a/frb_example/dart_minimal/rust/src/frb_generated.web.rs b/frb_example/dart_minimal/rust/src/frb_generated.web.rs index 3fa0aa9fbb..ca93c53d05 100644 --- a/frb_example/dart_minimal/rust/src/frb_generated.web.rs +++ b/frb_example/dart_minimal/rust/src/frb_generated.web.rs @@ -4,7 +4,6 @@ // Section: imports use super::*; -use crate::api::minimal::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; use flutter_rust_bridge::for_generated::transform_result_dco; use flutter_rust_bridge::for_generated::wasm_bindgen; @@ -21,49 +20,11 @@ where (!self.is_null() && !self.is_undefined()).then(|| self.cst_decode()) } } -impl - CstDecode< - flutter_rust_bridge::RustOpaque>, - > for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - fn cst_decode( - self, - ) -> flutter_rust_bridge::RustOpaque> - { - unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } - } -} -impl - CstDecode< - flutter_rust_bridge::RustOpaque< - std::sync::RwLock<( - crate::api::minimal::MyOpaqueType, - crate::api::minimal::AnotherOpaqueType, - )>, - >, - > for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - fn cst_decode( - self, - ) -> flutter_rust_bridge::RustOpaque< - std::sync::RwLock<( - crate::api::minimal::MyOpaqueType, - crate::api::minimal::AnotherOpaqueType, - )>, - > { - unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } - } -} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { fn cst_decode(self) -> i32 { self.unchecked_into_f64() as _ } } -impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - fn cst_decode(self) -> usize { - self.unchecked_into_f64() as _ - } -} #[wasm_bindgen] pub fn dart_fn_deliver_output( @@ -82,16 +43,6 @@ pub fn dart_fn_deliver_output( FLUTTER_RUST_BRIDGE_HANDLER.dart_fn_handle_output(call_id, message) } -#[wasm_bindgen] -pub fn wire_bar(port_: flutter_rust_bridge::for_generated::MessagePort) { - wire_bar_impl(port_) -} - -#[wasm_bindgen] -pub fn wire_foo(port_: flutter_rust_bridge::for_generated::MessagePort) { - wire_foo_impl(port_) -} - #[wasm_bindgen] pub fn wire_init_app(port_: flutter_rust_bridge::for_generated::MessagePort) { wire_init_app_impl(port_) @@ -101,53 +52,3 @@ pub fn wire_init_app(port_: flutter_rust_bridge::for_generated::MessagePort) { pub fn wire_minimal_adder(port_: flutter_rust_bridge::for_generated::MessagePort, a: i32, b: i32) { wire_minimal_adder_impl(port_, a, b) } - -#[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - ptr: *const std::ffi::c_void, -) { - unsafe { - flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< - std::sync::RwLock, - >(ptr); - } -} - -#[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalAnotherOpaqueType( - ptr: *const std::ffi::c_void, -) { - unsafe { - flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< - std::sync::RwLock, - >(ptr); - } -} - -#[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - ptr: *const std::ffi::c_void, -) { - unsafe { - flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< - std::sync::RwLock<( - crate::api::minimal::MyOpaqueType, - crate::api::minimal::AnotherOpaqueType, - )>, - >(ptr); - } -} - -#[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapiminimalMyOpaqueTypecrateapiminimalAnotherOpaqueType( - ptr: *const std::ffi::c_void, -) { - unsafe { - flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< - std::sync::RwLock<( - crate::api::minimal::MyOpaqueType, - crate::api::minimal::AnotherOpaqueType, - )>, - >(ptr); - } -} diff --git a/frb_example/pure_dart/rust/src/api/pseudo_manual/rust_auto_opaque_twin_sse.rs b/frb_example/pure_dart/rust/src/api/pseudo_manual/rust_auto_opaque_twin_sse.rs index 46a875620b..47c3a24050 100644 --- a/frb_example/pure_dart/rust/src/api/pseudo_manual/rust_auto_opaque_twin_sse.rs +++ b/frb_example/pure_dart/rust/src/api/pseudo_manual/rust_auto_opaque_twin_sse.rs @@ -5,6 +5,7 @@ // FRB_INTERNAL_GENERATOR: {"forbiddenDuplicatorModes": ["rustAsync", "rustAsyncSse"]} use flutter_rust_bridge::frb; +use std::path::PathBuf; // TODO auto determine it is opaque or not later #[frb(opaque)] @@ -267,3 +268,18 @@ pub fn rust_auto_opaque_struct_with_good_and_opaque_field_return_own_twin_sse( opaque: NonCloneSimpleTwinSse { inner: 42 }, } } + +// ================ misc =================== + +// #1577 - this should generate valid Dart code without name collisions +pub struct OpaqueOneTwinSse(PathBuf); +pub struct OpaqueTwoTwinSse(PathBuf); +#[flutter_rust_bridge::frb(serialize)] +pub fn rust_auto_opaque_return_opaque_one_and_two_twin_sse() -> (OpaqueOneTwinSse, OpaqueTwoTwinSse) +{ + unimplemented!() +} +#[flutter_rust_bridge::frb(serialize)] +pub fn rust_auto_opaque_return_opaque_two_twin_sse() -> OpaqueTwoTwinSse { + unimplemented!() +} diff --git a/frb_example/pure_dart/rust/src/api/pseudo_manual/rust_auto_opaque_twin_sync.rs b/frb_example/pure_dart/rust/src/api/pseudo_manual/rust_auto_opaque_twin_sync.rs index 29ee4086e7..328a87ac4b 100644 --- a/frb_example/pure_dart/rust/src/api/pseudo_manual/rust_auto_opaque_twin_sync.rs +++ b/frb_example/pure_dart/rust/src/api/pseudo_manual/rust_auto_opaque_twin_sync.rs @@ -5,6 +5,7 @@ // FRB_INTERNAL_GENERATOR: {"forbiddenDuplicatorModes": ["rustAsync", "rustAsyncSse"]} use flutter_rust_bridge::frb; +use std::path::PathBuf; // TODO auto determine it is opaque or not later #[frb(opaque)] @@ -267,3 +268,18 @@ pub fn rust_auto_opaque_struct_with_good_and_opaque_field_return_own_twin_sync( opaque: NonCloneSimpleTwinSync { inner: 42 }, } } + +// ================ misc =================== + +// #1577 - this should generate valid Dart code without name collisions +pub struct OpaqueOneTwinSync(PathBuf); +pub struct OpaqueTwoTwinSync(PathBuf); +#[flutter_rust_bridge::frb(sync)] +pub fn rust_auto_opaque_return_opaque_one_and_two_twin_sync( +) -> (OpaqueOneTwinSync, OpaqueTwoTwinSync) { + unimplemented!() +} +#[flutter_rust_bridge::frb(sync)] +pub fn rust_auto_opaque_return_opaque_two_twin_sync() -> OpaqueTwoTwinSync { + unimplemented!() +} diff --git a/frb_example/pure_dart/rust/src/api/pseudo_manual/rust_auto_opaque_twin_sync_sse.rs b/frb_example/pure_dart/rust/src/api/pseudo_manual/rust_auto_opaque_twin_sync_sse.rs index 4283226927..36858f7cd4 100644 --- a/frb_example/pure_dart/rust/src/api/pseudo_manual/rust_auto_opaque_twin_sync_sse.rs +++ b/frb_example/pure_dart/rust/src/api/pseudo_manual/rust_auto_opaque_twin_sync_sse.rs @@ -5,6 +5,7 @@ // FRB_INTERNAL_GENERATOR: {"forbiddenDuplicatorModes": ["rustAsync", "rustAsyncSse"]} use flutter_rust_bridge::frb; +use std::path::PathBuf; // TODO auto determine it is opaque or not later #[frb(opaque)] @@ -312,3 +313,20 @@ pub fn rust_auto_opaque_struct_with_good_and_opaque_field_return_own_twin_sync_s opaque: NonCloneSimpleTwinSyncSse { inner: 42 }, } } + +// ================ misc =================== + +// #1577 - this should generate valid Dart code without name collisions +pub struct OpaqueOneTwinSyncSse(PathBuf); +pub struct OpaqueTwoTwinSyncSse(PathBuf); +#[flutter_rust_bridge::frb(serialize)] +#[flutter_rust_bridge::frb(sync)] +pub fn rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse( +) -> (OpaqueOneTwinSyncSse, OpaqueTwoTwinSyncSse) { + unimplemented!() +} +#[flutter_rust_bridge::frb(serialize)] +#[flutter_rust_bridge::frb(sync)] +pub fn rust_auto_opaque_return_opaque_two_twin_sync_sse() -> OpaqueTwoTwinSyncSse { + unimplemented!() +} From 0ad49136d94a2155ef78a07613670a4322c2d6ee Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:23:52 +0800 Subject: [PATCH 11/17] chore: more codegen --- frb_example/pure_dart/frb_generated.h | 82 ++ .../rust_auto_opaque_twin_sse.dart | 46 + .../rust_auto_opaque_twin_sync.dart | 47 + .../rust_auto_opaque_twin_sync_sse.dart | 47 + .../lib/src/rust/api/rust_auto_opaque.dart | 48 + .../pure_dart/lib/src/rust/frb_generated.dart | 862 ++++++++++++++++++ .../lib/src/rust/frb_generated.io.dart | 757 +++++++++++++++ .../lib/src/rust/frb_generated.web.dart | 602 ++++++++++++ .../pure_dart/rust/src/frb_generated.io.rs | 437 +++++++++ .../pure_dart/rust/src/frb_generated.rs | 300 ++++++ .../pure_dart/rust/src/frb_generated.web.rs | 437 +++++++++ 11 files changed, 3665 insertions(+) diff --git a/frb_example/pure_dart/frb_generated.h b/frb_example/pure_dart/frb_generated.h index 431ac683f0..1e6e76d812 100644 --- a/frb_example/pure_dart/frb_generated.h +++ b/frb_example/pure_dart/frb_generated.h @@ -8524,6 +8524,16 @@ void frbgen_frb_example_pure_dart_wire_rust_auto_opaque_plus_sign_return_twin_ss int32_t rust_vec_len_, int32_t data_len_); +void frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse(int64_t port_, + uint8_t *ptr_, + int32_t rust_vec_len_, + int32_t data_len_); + +void frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_sse(int64_t port_, + uint8_t *ptr_, + int32_t rust_vec_len_, + int32_t data_len_); + void frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_own_twin_sse(int64_t port_, uint8_t *ptr_, int32_t rust_vec_len_, @@ -8624,6 +8634,10 @@ WireSyncRust2DartDco frbgen_frb_example_pure_dart_wire_rust_auto_opaque_plus_sig WireSyncRust2DartDco frbgen_frb_example_pure_dart_wire_rust_auto_opaque_plus_sign_return_twin_sync(void); +WireSyncRust2DartDco frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync(void); + +WireSyncRust2DartDco frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_sync(void); + WireSyncRust2DartDco frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_own_twin_sync(int32_t initial); WireSyncRust2DartDco frbgen_frb_example_pure_dart_wire_rust_auto_opaque_struct_with_good_and_opaque_field_arg_borrow_twin_sync(const void *arg); @@ -8730,6 +8744,14 @@ WireSyncRust2DartSse frbgen_frb_example_pure_dart_wire_rust_auto_opaque_plus_sig int32_t rust_vec_len_, int32_t data_len_); +WireSyncRust2DartSse frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse(uint8_t *ptr_, + int32_t rust_vec_len_, + int32_t data_len_); + +WireSyncRust2DartSse frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_sync_sse(uint8_t *ptr_, + int32_t rust_vec_len_, + int32_t data_len_); + WireSyncRust2DartSse frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_own_twin_sync_sse(uint8_t *ptr_, int32_t rust_vec_len_, int32_t data_len_); @@ -9475,6 +9497,10 @@ void frbgen_frb_example_pure_dart_wire_rust_auto_opaque_plus_sign_arg_twin_norma void frbgen_frb_example_pure_dart_wire_rust_auto_opaque_plus_sign_return_twin_normal(int64_t port_); +void frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal(int64_t port_); + +void frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_normal(int64_t port_); + void frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_own_twin_normal(int64_t port_, int32_t initial); @@ -9749,6 +9775,38 @@ void frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_std void frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse(const void *ptr); +void frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal(const void *ptr); + +void frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal(const void *ptr); + struct wire_cst_application_env *frbgen_frb_example_pure_dart_cst_new_box_application_env(void); int64_t *frbgen_frb_example_pure_dart_cst_new_box_autoadd_Chrono_Duration(int64_t value); @@ -11136,6 +11194,14 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSse); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSync); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_MutexHideData); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_RwLockHideData); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_box_dynDartDebugTwinNormal); @@ -11167,6 +11233,14 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSse); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSync); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_ConcatenateWithTwinNormal_concatenate_static_twin_normal); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_ConcatenateWithTwinNormal_concatenate_twin_normal); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_ConcatenateWithTwinNormal_handle_some_static_stream_sink_single_arg_twin_normal); @@ -12461,6 +12535,14 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_rust_auto_opaque_plus_sign_return_twin_sse); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_rust_auto_opaque_plus_sign_return_twin_sync); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_rust_auto_opaque_plus_sign_return_twin_sync_sse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_normal); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_sse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_sync); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_sync_sse); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_own_twin_normal); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_own_twin_sse); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_own_twin_sync); diff --git a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/rust_auto_opaque_twin_sse.dart b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/rust_auto_opaque_twin_sse.dart index e26e1c88b6..d6c33e09df 100644 --- a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/rust_auto_opaque_twin_sse.dart +++ b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/rust_auto_opaque_twin_sse.dart @@ -120,6 +120,14 @@ Future .rustAutoOpaqueStructWithGoodAndOpaqueFieldReturnOwnTwinSse( hint: hint); +Future + rustAutoOpaqueReturnOpaqueOneAndTwoTwinSse({dynamic hint}) => + RustLib.instance.api + .rustAutoOpaqueReturnOpaqueOneAndTwoTwinSse(hint: hint); + +Future rustAutoOpaqueReturnOpaqueTwoTwinSse({dynamic hint}) => + RustLib.instance.api.rustAutoOpaqueReturnOpaqueTwoTwinSse(hint: hint); + // Rust type: flutter_rust_bridge::RustOpaque String + Send + Sync>>> @sealed class BoxFnStringString extends RustOpaque { @@ -271,3 +279,41 @@ class StructWithGoodAndOpaqueFieldTwinSse extends RustOpaque { .rust_arc_decrement_strong_count_StructWithGoodAndOpaqueFieldTwinSsePtr, ); } + +// Rust type: flutter_rust_bridge::RustOpaque> +@sealed +class OpaqueOneTwinSseOpaqueTwoTwinSse extends RustOpaque { + OpaqueOneTwinSseOpaqueTwoTwinSse.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + OpaqueOneTwinSseOpaqueTwoTwinSse.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: RustLib.instance.api + .rust_arc_increment_strong_count_OpaqueOneTwinSseOpaqueTwoTwinSse, + rustArcDecrementStrongCount: RustLib.instance.api + .rust_arc_decrement_strong_count_OpaqueOneTwinSseOpaqueTwoTwinSse, + rustArcDecrementStrongCountPtr: RustLib.instance.api + .rust_arc_decrement_strong_count_OpaqueOneTwinSseOpaqueTwoTwinSsePtr, + ); +} + +// Rust type: flutter_rust_bridge::RustOpaque> +@sealed +class OpaqueTwoTwinSse extends RustOpaque { + OpaqueTwoTwinSse.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + OpaqueTwoTwinSse.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_OpaqueTwoTwinSse, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_OpaqueTwoTwinSse, + rustArcDecrementStrongCountPtr: RustLib + .instance.api.rust_arc_decrement_strong_count_OpaqueTwoTwinSsePtr, + ); +} diff --git a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/rust_auto_opaque_twin_sync.dart b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/rust_auto_opaque_twin_sync.dart index 86cf2f537b..238f4a2a3a 100644 --- a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/rust_auto_opaque_twin_sync.dart +++ b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/rust_auto_opaque_twin_sync.dart @@ -123,6 +123,14 @@ StructWithGoodAndOpaqueFieldTwinSync .rustAutoOpaqueStructWithGoodAndOpaqueFieldReturnOwnTwinSync( hint: hint); +OpaqueOneTwinSyncOpaqueTwoTwinSync rustAutoOpaqueReturnOpaqueOneAndTwoTwinSync( + {dynamic hint}) => + RustLib.instance.api + .rustAutoOpaqueReturnOpaqueOneAndTwoTwinSync(hint: hint); + +OpaqueTwoTwinSync rustAutoOpaqueReturnOpaqueTwoTwinSync({dynamic hint}) => + RustLib.instance.api.rustAutoOpaqueReturnOpaqueTwoTwinSync(hint: hint); + // Rust type: flutter_rust_bridge::RustOpaque>> @sealed class BoxHelloTraitTwinSync extends RustOpaque { @@ -255,3 +263,42 @@ class StructWithGoodAndOpaqueFieldTwinSync extends RustOpaque { .rust_arc_decrement_strong_count_StructWithGoodAndOpaqueFieldTwinSyncPtr, ); } + +// Rust type: flutter_rust_bridge::RustOpaque> +@sealed +class OpaqueOneTwinSyncOpaqueTwoTwinSync extends RustOpaque { + OpaqueOneTwinSyncOpaqueTwoTwinSync.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + OpaqueOneTwinSyncOpaqueTwoTwinSync.sseDecode( + int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: RustLib.instance.api + .rust_arc_increment_strong_count_OpaqueOneTwinSyncOpaqueTwoTwinSync, + rustArcDecrementStrongCount: RustLib.instance.api + .rust_arc_decrement_strong_count_OpaqueOneTwinSyncOpaqueTwoTwinSync, + rustArcDecrementStrongCountPtr: RustLib.instance.api + .rust_arc_decrement_strong_count_OpaqueOneTwinSyncOpaqueTwoTwinSyncPtr, + ); +} + +// Rust type: flutter_rust_bridge::RustOpaque> +@sealed +class OpaqueTwoTwinSync extends RustOpaque { + OpaqueTwoTwinSync.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + OpaqueTwoTwinSync.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_OpaqueTwoTwinSync, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_OpaqueTwoTwinSync, + rustArcDecrementStrongCountPtr: RustLib + .instance.api.rust_arc_decrement_strong_count_OpaqueTwoTwinSyncPtr, + ); +} diff --git a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/rust_auto_opaque_twin_sync_sse.dart b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/rust_auto_opaque_twin_sync_sse.dart index 7ab89e30d8..fbb277e130 100644 --- a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/rust_auto_opaque_twin_sync_sse.dart +++ b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/rust_auto_opaque_twin_sync_sse.dart @@ -126,6 +126,14 @@ StructWithGoodAndOpaqueFieldTwinSyncSse .rustAutoOpaqueStructWithGoodAndOpaqueFieldReturnOwnTwinSyncSse( hint: hint); +OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + rustAutoOpaqueReturnOpaqueOneAndTwoTwinSyncSse({dynamic hint}) => + RustLib.instance.api + .rustAutoOpaqueReturnOpaqueOneAndTwoTwinSyncSse(hint: hint); + +OpaqueTwoTwinSyncSse rustAutoOpaqueReturnOpaqueTwoTwinSyncSse({dynamic hint}) => + RustLib.instance.api.rustAutoOpaqueReturnOpaqueTwoTwinSyncSse(hint: hint); + // Rust type: flutter_rust_bridge::RustOpaque>> @sealed class BoxHelloTraitTwinSyncSse extends RustOpaque { @@ -264,3 +272,42 @@ class StructWithGoodAndOpaqueFieldTwinSyncSse extends RustOpaque { .rust_arc_decrement_strong_count_StructWithGoodAndOpaqueFieldTwinSyncSsePtr, ); } + +// Rust type: flutter_rust_bridge::RustOpaque> +@sealed +class OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse extends RustOpaque { + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse.sseDecode( + int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: RustLib.instance.api + .rust_arc_increment_strong_count_OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse, + rustArcDecrementStrongCount: RustLib.instance.api + .rust_arc_decrement_strong_count_OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse, + rustArcDecrementStrongCountPtr: RustLib.instance.api + .rust_arc_decrement_strong_count_OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSsePtr, + ); +} + +// Rust type: flutter_rust_bridge::RustOpaque> +@sealed +class OpaqueTwoTwinSyncSse extends RustOpaque { + OpaqueTwoTwinSyncSse.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + OpaqueTwoTwinSyncSse.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: RustLib + .instance.api.rust_arc_increment_strong_count_OpaqueTwoTwinSyncSse, + rustArcDecrementStrongCount: RustLib + .instance.api.rust_arc_decrement_strong_count_OpaqueTwoTwinSyncSse, + rustArcDecrementStrongCountPtr: RustLib + .instance.api.rust_arc_decrement_strong_count_OpaqueTwoTwinSyncSsePtr, + ); +} diff --git a/frb_example/pure_dart/lib/src/rust/api/rust_auto_opaque.dart b/frb_example/pure_dart/lib/src/rust/api/rust_auto_opaque.dart index 49f33451c5..60fa303a1f 100644 --- a/frb_example/pure_dart/lib/src/rust/api/rust_auto_opaque.dart +++ b/frb_example/pure_dart/lib/src/rust/api/rust_auto_opaque.dart @@ -128,6 +128,15 @@ Future .rustAutoOpaqueStructWithGoodAndOpaqueFieldReturnOwnTwinNormal( hint: hint); +Future + rustAutoOpaqueReturnOpaqueOneAndTwoTwinNormal({dynamic hint}) => + RustLib.instance.api + .rustAutoOpaqueReturnOpaqueOneAndTwoTwinNormal(hint: hint); + +Future rustAutoOpaqueReturnOpaqueTwoTwinNormal( + {dynamic hint}) => + RustLib.instance.api.rustAutoOpaqueReturnOpaqueTwoTwinNormal(hint: hint); + // Rust type: flutter_rust_bridge::RustOpaque>> @sealed class BoxHelloTraitTwinNormal extends RustOpaque { @@ -267,3 +276,42 @@ class StructWithGoodAndOpaqueFieldTwinNormal extends RustOpaque { .rust_arc_decrement_strong_count_StructWithGoodAndOpaqueFieldTwinNormalPtr, ); } + +// Rust type: flutter_rust_bridge::RustOpaque> +@sealed +class OpaqueOneTwinNormalOpaqueTwoTwinNormal extends RustOpaque { + OpaqueOneTwinNormalOpaqueTwoTwinNormal.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + OpaqueOneTwinNormalOpaqueTwoTwinNormal.sseDecode( + int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: RustLib.instance.api + .rust_arc_increment_strong_count_OpaqueOneTwinNormalOpaqueTwoTwinNormal, + rustArcDecrementStrongCount: RustLib.instance.api + .rust_arc_decrement_strong_count_OpaqueOneTwinNormalOpaqueTwoTwinNormal, + rustArcDecrementStrongCountPtr: RustLib.instance.api + .rust_arc_decrement_strong_count_OpaqueOneTwinNormalOpaqueTwoTwinNormalPtr, + ); +} + +// Rust type: flutter_rust_bridge::RustOpaque> +@sealed +class OpaqueTwoTwinNormal extends RustOpaque { + OpaqueTwoTwinNormal.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + OpaqueTwoTwinNormal.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: RustLib + .instance.api.rust_arc_increment_strong_count_OpaqueTwoTwinNormal, + rustArcDecrementStrongCount: RustLib + .instance.api.rust_arc_decrement_strong_count_OpaqueTwoTwinNormal, + rustArcDecrementStrongCountPtr: RustLib + .instance.api.rust_arc_decrement_strong_count_OpaqueTwoTwinNormalPtr, + ); +} diff --git a/frb_example/pure_dart/lib/src/rust/frb_generated.dart b/frb_example/pure_dart/lib/src/rust/frb_generated.dart index 533f974ee5..85f9d7845d 100644 --- a/frb_example/pure_dart/lib/src/rust/frb_generated.dart +++ b/frb_example/pure_dart/lib/src/rust/frb_generated.dart @@ -3720,6 +3720,11 @@ abstract class RustLibApi extends BaseApi { Future rustAutoOpaquePlusSignReturnTwinSse({dynamic hint}); + Future + rustAutoOpaqueReturnOpaqueOneAndTwoTwinSse({dynamic hint}); + + Future rustAutoOpaqueReturnOpaqueTwoTwinSse({dynamic hint}); + Future rustAutoOpaqueReturnOwnTwinSse( {required int initial, dynamic hint}); @@ -3822,6 +3827,11 @@ abstract class RustLibApi extends BaseApi { BoxMyTraitTwinSync rustAutoOpaquePlusSignReturnTwinSync({dynamic hint}); + OpaqueOneTwinSyncOpaqueTwoTwinSync + rustAutoOpaqueReturnOpaqueOneAndTwoTwinSync({dynamic hint}); + + OpaqueTwoTwinSync rustAutoOpaqueReturnOpaqueTwoTwinSync({dynamic hint}); + NonCloneSimpleTwinSync rustAutoOpaqueReturnOwnTwinSync( {required int initial, dynamic hint}); @@ -3930,6 +3940,11 @@ abstract class RustLibApi extends BaseApi { BoxMyTraitTwinSyncSse rustAutoOpaquePlusSignReturnTwinSyncSse({dynamic hint}); + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + rustAutoOpaqueReturnOpaqueOneAndTwoTwinSyncSse({dynamic hint}); + + OpaqueTwoTwinSyncSse rustAutoOpaqueReturnOpaqueTwoTwinSyncSse({dynamic hint}); + NonCloneSimpleTwinSyncSse rustAutoOpaqueReturnOwnTwinSyncSse( {required int initial, dynamic hint}); @@ -4482,6 +4497,12 @@ abstract class RustLibApi extends BaseApi { Future rustAutoOpaquePlusSignReturnTwinNormal( {dynamic hint}); + Future + rustAutoOpaqueReturnOpaqueOneAndTwoTwinNormal({dynamic hint}); + + Future rustAutoOpaqueReturnOpaqueTwoTwinNormal( + {dynamic hint}); + Future rustAutoOpaqueReturnOwnTwinNormal( {required int initial, dynamic hint}); @@ -4912,6 +4933,78 @@ abstract class RustLibApi extends BaseApi { CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_StructWithGoodAndOpaqueFieldTwinSyncSsePtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueOneTwinSseOpaqueTwoTwinSse; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueOneTwinSseOpaqueTwoTwinSse; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueOneTwinSseOpaqueTwoTwinSsePtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueTwoTwinSse; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueTwoTwinSse; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueTwoTwinSsePtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueOneTwinSyncOpaqueTwoTwinSync; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueOneTwinSyncOpaqueTwoTwinSync; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueOneTwinSyncOpaqueTwoTwinSyncPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueTwoTwinSync; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueTwoTwinSync; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueTwoTwinSyncPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSsePtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueTwoTwinSyncSse; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueTwoTwinSyncSse; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueTwoTwinSyncSsePtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueOneTwinNormalOpaqueTwoTwinNormal; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueOneTwinNormalOpaqueTwoTwinNormal; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueOneTwinNormalOpaqueTwoTwinNormalPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueTwoTwinNormal; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueTwoTwinNormal; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueTwoTwinNormalPtr; } class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @@ -37388,6 +37481,64 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: [], ); + @override + Future + rustAutoOpaqueReturnOpaqueOneAndTwoTwinSse({dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + + final raw_ = serializer.intoRaw(); + return wire.wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse( + port_, raw_.ptr, raw_.rustVecLen, raw_.dataLen); + }, + codec: SseCodec( + decodeSuccessData: + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse, + decodeErrorData: null, + ), + constMeta: kRustAutoOpaqueReturnOpaqueOneAndTwoTwinSseConstMeta, + argValues: [], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kRustAutoOpaqueReturnOpaqueOneAndTwoTwinSseConstMeta => + const TaskConstMeta( + debugName: "rust_auto_opaque_return_opaque_one_and_two_twin_sse", + argNames: [], + ); + + @override + Future rustAutoOpaqueReturnOpaqueTwoTwinSse( + {dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + + final raw_ = serializer.intoRaw(); + return wire.wire_rust_auto_opaque_return_opaque_two_twin_sse( + port_, raw_.ptr, raw_.rustVecLen, raw_.dataLen); + }, + codec: SseCodec( + decodeSuccessData: + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse, + decodeErrorData: null, + ), + constMeta: kRustAutoOpaqueReturnOpaqueTwoTwinSseConstMeta, + argValues: [], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kRustAutoOpaqueReturnOpaqueTwoTwinSseConstMeta => + const TaskConstMeta( + debugName: "rust_auto_opaque_return_opaque_two_twin_sse", + argNames: [], + ); + @override Future rustAutoOpaqueReturnOwnTwinSse( {required int initial, dynamic hint}) { @@ -38312,6 +38463,55 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: [], ); + @override + OpaqueOneTwinSyncOpaqueTwoTwinSync + rustAutoOpaqueReturnOpaqueOneAndTwoTwinSync({dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + return wire.wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync(); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync, + decodeErrorData: null, + ), + constMeta: kRustAutoOpaqueReturnOpaqueOneAndTwoTwinSyncConstMeta, + argValues: [], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kRustAutoOpaqueReturnOpaqueOneAndTwoTwinSyncConstMeta => + const TaskConstMeta( + debugName: "rust_auto_opaque_return_opaque_one_and_two_twin_sync", + argNames: [], + ); + + @override + OpaqueTwoTwinSync rustAutoOpaqueReturnOpaqueTwoTwinSync({dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + return wire.wire_rust_auto_opaque_return_opaque_two_twin_sync(); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync, + decodeErrorData: null, + ), + constMeta: kRustAutoOpaqueReturnOpaqueTwoTwinSyncConstMeta, + argValues: [], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kRustAutoOpaqueReturnOpaqueTwoTwinSyncConstMeta => + const TaskConstMeta( + debugName: "rust_auto_opaque_return_opaque_two_twin_sync", + argNames: [], + ); + @override NonCloneSimpleTwinSync rustAutoOpaqueReturnOwnTwinSync( {required int initial, dynamic hint}) { @@ -39274,6 +39474,65 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: [], ); + @override + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + rustAutoOpaqueReturnOpaqueOneAndTwoTwinSyncSse({dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + + final raw_ = serializer.intoRaw(); + return wire + .wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse( + raw_.ptr, raw_.rustVecLen, raw_.dataLen); + }, + codec: SseCodec( + decodeSuccessData: + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse, + decodeErrorData: null, + ), + constMeta: kRustAutoOpaqueReturnOpaqueOneAndTwoTwinSyncSseConstMeta, + argValues: [], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kRustAutoOpaqueReturnOpaqueOneAndTwoTwinSyncSseConstMeta => + const TaskConstMeta( + debugName: "rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse", + argNames: [], + ); + + @override + OpaqueTwoTwinSyncSse rustAutoOpaqueReturnOpaqueTwoTwinSyncSse( + {dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + + final raw_ = serializer.intoRaw(); + return wire.wire_rust_auto_opaque_return_opaque_two_twin_sync_sse( + raw_.ptr, raw_.rustVecLen, raw_.dataLen); + }, + codec: SseCodec( + decodeSuccessData: + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse, + decodeErrorData: null, + ), + constMeta: kRustAutoOpaqueReturnOpaqueTwoTwinSyncSseConstMeta, + argValues: [], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kRustAutoOpaqueReturnOpaqueTwoTwinSyncSseConstMeta => + const TaskConstMeta( + debugName: "rust_auto_opaque_return_opaque_two_twin_sync_sse", + argNames: [], + ); + @override NonCloneSimpleTwinSyncSse rustAutoOpaqueReturnOwnTwinSyncSse( {required int initial, dynamic hint}) { @@ -44654,6 +44913,57 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: [], ); + @override + Future + rustAutoOpaqueReturnOpaqueOneAndTwoTwinNormal({dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + return wire + .wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal(port_); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal, + decodeErrorData: null, + ), + constMeta: kRustAutoOpaqueReturnOpaqueOneAndTwoTwinNormalConstMeta, + argValues: [], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kRustAutoOpaqueReturnOpaqueOneAndTwoTwinNormalConstMeta => + const TaskConstMeta( + debugName: "rust_auto_opaque_return_opaque_one_and_two_twin_normal", + argNames: [], + ); + + @override + Future rustAutoOpaqueReturnOpaqueTwoTwinNormal( + {dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + return wire.wire_rust_auto_opaque_return_opaque_two_twin_normal(port_); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal, + decodeErrorData: null, + ), + constMeta: kRustAutoOpaqueReturnOpaqueTwoTwinNormalConstMeta, + argValues: [], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kRustAutoOpaqueReturnOpaqueTwoTwinNormalConstMeta => + const TaskConstMeta( + debugName: "rust_auto_opaque_return_opaque_two_twin_normal", + argNames: [], + ); + @override Future rustAutoOpaqueReturnOwnTwinNormal( {required int initial, dynamic hint}) { @@ -46525,6 +46835,70 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { get rust_arc_decrement_strong_count_StructWithGoodAndOpaqueFieldTwinSyncSse => wire.rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse; + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueOneTwinSseOpaqueTwoTwinSse => wire + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueOneTwinSseOpaqueTwoTwinSse => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueTwoTwinSse => wire + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueTwoTwinSse => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueOneTwinSyncOpaqueTwoTwinSync => + wire.rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueOneTwinSyncOpaqueTwoTwinSync => + wire.rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueTwoTwinSync => wire + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueTwoTwinSync => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse => + wire.rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse => + wire.rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueTwoTwinSyncSse => wire + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueTwoTwinSyncSse => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueOneTwinNormalOpaqueTwoTwinNormal => + wire.rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueOneTwinNormalOpaqueTwoTwinNormal => + wire.rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OpaqueTwoTwinNormal => wire + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OpaqueTwoTwinNormal => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal; + @protected AnyhowException dco_decode_AnyhowException(dynamic raw) { return AnyhowException(raw as String); @@ -46651,6 +47025,64 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { raw as List); } + @protected + OpaqueOneTwinSseOpaqueTwoTwinSse + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic raw) { + return OpaqueOneTwinSseOpaqueTwoTwinSse.dcoDecode(raw as List); + } + + @protected + OpaqueTwoTwinSse + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic raw) { + return OpaqueTwoTwinSse.dcoDecode(raw as List); + } + + @protected + OpaqueOneTwinSyncOpaqueTwoTwinSync + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic raw) { + return OpaqueOneTwinSyncOpaqueTwoTwinSync.dcoDecode(raw as List); + } + + @protected + OpaqueTwoTwinSync + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic raw) { + return OpaqueTwoTwinSync.dcoDecode(raw as List); + } + + @protected + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic raw) { + return OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse.dcoDecode( + raw as List); + } + + @protected + OpaqueTwoTwinSyncSse + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic raw) { + return OpaqueTwoTwinSyncSse.dcoDecode(raw as List); + } + + @protected + OpaqueOneTwinNormalOpaqueTwoTwinNormal + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic raw) { + return OpaqueOneTwinNormalOpaqueTwoTwinNormal.dcoDecode( + raw as List); + } + + @protected + OpaqueTwoTwinNormal + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic raw) { + return OpaqueTwoTwinNormal.dcoDecode(raw as List); + } + @protected BoxHelloTraitTwinNormal dco_decode_Auto_RefMut_RustOpaque_stdsyncRwLockBoxdynHelloTraitTwinNormal( @@ -47147,6 +47579,64 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { raw as List); } + @protected + OpaqueOneTwinSseOpaqueTwoTwinSse + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic raw) { + return OpaqueOneTwinSseOpaqueTwoTwinSse.dcoDecode(raw as List); + } + + @protected + OpaqueTwoTwinSse + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic raw) { + return OpaqueTwoTwinSse.dcoDecode(raw as List); + } + + @protected + OpaqueOneTwinSyncOpaqueTwoTwinSync + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic raw) { + return OpaqueOneTwinSyncOpaqueTwoTwinSync.dcoDecode(raw as List); + } + + @protected + OpaqueTwoTwinSync + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic raw) { + return OpaqueTwoTwinSync.dcoDecode(raw as List); + } + + @protected + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic raw) { + return OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse.dcoDecode( + raw as List); + } + + @protected + OpaqueTwoTwinSyncSse + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic raw) { + return OpaqueTwoTwinSyncSse.dcoDecode(raw as List); + } + + @protected + OpaqueOneTwinNormalOpaqueTwoTwinNormal + dco_decode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic raw) { + return OpaqueOneTwinNormalOpaqueTwoTwinNormal.dcoDecode( + raw as List); + } + + @protected + OpaqueTwoTwinNormal + dco_decode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic raw) { + return OpaqueTwoTwinNormal.dcoDecode(raw as List); + } + @protected String dco_decode_String(dynamic raw) { return raw as String; @@ -56453,6 +56943,70 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } + @protected + OpaqueOneTwinSseOpaqueTwoTwinSse + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + SseDeserializer deserializer) { + return OpaqueOneTwinSseOpaqueTwoTwinSse.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OpaqueTwoTwinSse + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + SseDeserializer deserializer) { + return OpaqueTwoTwinSse.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OpaqueOneTwinSyncOpaqueTwoTwinSync + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + SseDeserializer deserializer) { + return OpaqueOneTwinSyncOpaqueTwoTwinSync.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OpaqueTwoTwinSync + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + SseDeserializer deserializer) { + return OpaqueTwoTwinSync.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + SseDeserializer deserializer) { + return OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OpaqueTwoTwinSyncSse + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + SseDeserializer deserializer) { + return OpaqueTwoTwinSyncSse.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OpaqueOneTwinNormalOpaqueTwoTwinNormal + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + SseDeserializer deserializer) { + return OpaqueOneTwinNormalOpaqueTwoTwinNormal.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OpaqueTwoTwinNormal + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + SseDeserializer deserializer) { + return OpaqueTwoTwinNormal.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + @protected BoxHelloTraitTwinNormal sse_decode_Auto_RefMut_RustOpaque_stdsyncRwLockBoxdynHelloTraitTwinNormal( @@ -56927,6 +57481,70 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } + @protected + OpaqueOneTwinSseOpaqueTwoTwinSse + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + SseDeserializer deserializer) { + return OpaqueOneTwinSseOpaqueTwoTwinSse.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OpaqueTwoTwinSse + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + SseDeserializer deserializer) { + return OpaqueTwoTwinSse.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OpaqueOneTwinSyncOpaqueTwoTwinSync + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + SseDeserializer deserializer) { + return OpaqueOneTwinSyncOpaqueTwoTwinSync.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OpaqueTwoTwinSync + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + SseDeserializer deserializer) { + return OpaqueTwoTwinSync.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + SseDeserializer deserializer) { + return OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OpaqueTwoTwinSyncSse + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + SseDeserializer deserializer) { + return OpaqueTwoTwinSyncSse.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OpaqueOneTwinNormalOpaqueTwoTwinNormal + sse_decode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + SseDeserializer deserializer) { + return OpaqueOneTwinNormalOpaqueTwoTwinNormal.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OpaqueTwoTwinNormal + sse_decode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + SseDeserializer deserializer) { + return OpaqueTwoTwinNormal.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + @protected String sse_decode_String(SseDeserializer deserializer) { var inner = sse_decode_list_prim_u_8(deserializer); @@ -66442,6 +67060,70 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return raw.cstEncode(move: true); } + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueOneTwinSseOpaqueTwoTwinSse raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueTwoTwinSse raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueOneTwinSyncOpaqueTwoTwinSync raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueTwoTwinSync raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueTwoTwinSyncSse raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueOneTwinNormalOpaqueTwoTwinNormal raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueTwoTwinNormal raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + @protected PlatformPointer cst_encode_Auto_RefMut_RustOpaque_stdsyncRwLockBoxdynHelloTraitTwinNormal( @@ -66978,6 +67660,70 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return raw.cstEncode(); } + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueOneTwinSseOpaqueTwoTwinSse raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueTwoTwinSse raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueOneTwinSyncOpaqueTwoTwinSync raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueTwoTwinSync raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueTwoTwinSyncSse raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueOneTwinNormalOpaqueTwoTwinNormal raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueTwoTwinNormal raw) { + // ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + @protected int cst_encode_application_mode(ApplicationMode raw) { return cst_encode_i_32(raw.index); @@ -67230,6 +67976,64 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_usize(self.sseEncode(move: true), serializer); } + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueOneTwinSseOpaqueTwoTwinSse self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueTwoTwinSse self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueOneTwinSyncOpaqueTwoTwinSync self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueTwoTwinSync self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse self, + SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueTwoTwinSyncSse self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueOneTwinNormalOpaqueTwoTwinNormal self, + SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueTwoTwinNormal self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: true), serializer); + } + @protected void sse_encode_Auto_RefMut_RustOpaque_stdsyncRwLockBoxdynHelloTraitTwinNormal( @@ -67763,6 +68567,64 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_usize(self.sseEncode(move: null), serializer); } + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueOneTwinSseOpaqueTwoTwinSse self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueTwoTwinSse self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueOneTwinSyncOpaqueTwoTwinSync self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueTwoTwinSync self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse self, + SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueTwoTwinSyncSse self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueOneTwinNormalOpaqueTwoTwinNormal self, + SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueTwoTwinNormal self, SseSerializer serializer) { + sse_encode_usize(self.sseEncode(move: null), serializer); + } + @protected void sse_encode_String(String self, SseSerializer serializer) { sse_encode_list_prim_u_8(utf8.encoder.convert(self), serializer); diff --git a/frb_example/pure_dart/lib/src/rust/frb_generated.io.dart b/frb_example/pure_dart/lib/src/rust/frb_generated.io.dart index eb518f8987..9653af1572 100644 --- a/frb_example/pure_dart/lib/src/rust/frb_generated.io.dart +++ b/frb_example/pure_dart/lib/src/rust/frb_generated.io.dart @@ -337,6 +337,38 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { get rust_arc_decrement_strong_count_StructWithGoodAndOpaqueFieldTwinSyncSsePtr => wire._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSsePtr; + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueOneTwinSseOpaqueTwoTwinSsePtr => + wire._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSsePtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueTwoTwinSsePtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSsePtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueOneTwinSyncOpaqueTwoTwinSyncPtr => + wire._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSyncPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueTwoTwinSyncPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSyncPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSsePtr => + wire._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSsePtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueTwoTwinSyncSsePtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSsePtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueOneTwinNormalOpaqueTwoTwinNormalPtr => + wire._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormalPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueTwoTwinNormalPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormalPtr; + @protected AnyhowException dco_decode_AnyhowException(dynamic raw); @@ -425,6 +457,46 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse( dynamic raw); + @protected + OpaqueOneTwinSseOpaqueTwoTwinSse + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic raw); + + @protected + OpaqueTwoTwinSse + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic raw); + + @protected + OpaqueOneTwinSyncOpaqueTwoTwinSync + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic raw); + + @protected + OpaqueTwoTwinSync + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic raw); + + @protected + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic raw); + + @protected + OpaqueTwoTwinSyncSse + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic raw); + + @protected + OpaqueOneTwinNormalOpaqueTwoTwinNormal + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic raw); + + @protected + OpaqueTwoTwinNormal + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic raw); + @protected BoxHelloTraitTwinNormal dco_decode_Auto_RefMut_RustOpaque_stdsyncRwLockBoxdynHelloTraitTwinNormal( @@ -759,6 +831,46 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { dco_decode_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse( dynamic raw); + @protected + OpaqueOneTwinSseOpaqueTwoTwinSse + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic raw); + + @protected + OpaqueTwoTwinSse + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic raw); + + @protected + OpaqueOneTwinSyncOpaqueTwoTwinSync + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic raw); + + @protected + OpaqueTwoTwinSync + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic raw); + + @protected + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic raw); + + @protected + OpaqueTwoTwinSyncSse + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic raw); + + @protected + OpaqueOneTwinNormalOpaqueTwoTwinNormal + dco_decode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic raw); + + @protected + OpaqueTwoTwinNormal + dco_decode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic raw); + @protected String dco_decode_String(dynamic raw); @@ -4448,6 +4560,46 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse( SseDeserializer deserializer); + @protected + OpaqueOneTwinSseOpaqueTwoTwinSse + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinSse + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + SseDeserializer deserializer); + + @protected + OpaqueOneTwinSyncOpaqueTwoTwinSync + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinSync + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + SseDeserializer deserializer); + + @protected + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinSyncSse + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + SseDeserializer deserializer); + + @protected + OpaqueOneTwinNormalOpaqueTwoTwinNormal + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinNormal + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + SseDeserializer deserializer); + @protected BoxHelloTraitTwinNormal sse_decode_Auto_RefMut_RustOpaque_stdsyncRwLockBoxdynHelloTraitTwinNormal( @@ -4733,6 +4885,46 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { sse_decode_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse( SseDeserializer deserializer); + @protected + OpaqueOneTwinSseOpaqueTwoTwinSse + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinSse + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + SseDeserializer deserializer); + + @protected + OpaqueOneTwinSyncOpaqueTwoTwinSync + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinSync + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + SseDeserializer deserializer); + + @protected + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinSyncSse + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + SseDeserializer deserializer); + + @protected + OpaqueOneTwinNormalOpaqueTwoTwinNormal + sse_decode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinNormal + sse_decode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + SseDeserializer deserializer); + @protected String sse_decode_String(SseDeserializer deserializer); @@ -20896,6 +21088,46 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse( StructWithGoodAndOpaqueFieldTwinSyncSse raw); + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueOneTwinSseOpaqueTwoTwinSse raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueTwoTwinSse raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueOneTwinSyncOpaqueTwoTwinSync raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueTwoTwinSync raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueTwoTwinSyncSse raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueOneTwinNormalOpaqueTwoTwinNormal raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueTwoTwinNormal raw); + @protected PlatformPointer cst_encode_Auto_RefMut_RustOpaque_stdsyncRwLockBoxdynHelloTraitTwinNormal( @@ -21220,6 +21452,46 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { cst_encode_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse( StructWithGoodAndOpaqueFieldTwinSyncSse raw); + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueOneTwinSseOpaqueTwoTwinSse raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueTwoTwinSse raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueOneTwinSyncOpaqueTwoTwinSync raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueTwoTwinSync raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueTwoTwinSyncSse raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueOneTwinNormalOpaqueTwoTwinNormal raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueTwoTwinNormal raw); + @protected int cst_encode_application_mode(ApplicationMode raw); @@ -21383,6 +21655,48 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { StructWithGoodAndOpaqueFieldTwinSyncSse self, SseSerializer serializer); + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueOneTwinSseOpaqueTwoTwinSse self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueTwoTwinSse self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueOneTwinSyncOpaqueTwoTwinSync self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueTwoTwinSync self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse self, + SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueTwoTwinSyncSse self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueOneTwinNormalOpaqueTwoTwinNormal self, + SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueTwoTwinNormal self, SseSerializer serializer); + @protected void sse_encode_Auto_RefMut_RustOpaque_stdsyncRwLockBoxdynHelloTraitTwinNormal( @@ -21727,6 +22041,48 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { StructWithGoodAndOpaqueFieldTwinSyncSse self, SseSerializer serializer); + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueOneTwinSseOpaqueTwoTwinSse self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueTwoTwinSse self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueOneTwinSyncOpaqueTwoTwinSync self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueTwoTwinSync self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse self, + SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueTwoTwinSyncSse self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueOneTwinNormalOpaqueTwoTwinNormal self, + SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueTwoTwinNormal self, SseSerializer serializer); + @protected void sse_encode_String(String self, SseSerializer serializer); @@ -50059,6 +50415,52 @@ class RustLibWire implements BaseWire { _wire_rust_auto_opaque_plus_sign_return_twin_ssePtr .asFunction, int, int)>(); + void wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse( + int port_, + ffi.Pointer ptr_, + int rust_vec_len_, + int data_len_, + ) { + return _wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse( + port_, + ptr_, + rust_vec_len_, + data_len_, + ); + } + + late final _wire_rust_auto_opaque_return_opaque_one_and_two_twin_ssePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer, ffi.Int32, ffi.Int32)>>( + 'frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse'); + late final _wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse = + _wire_rust_auto_opaque_return_opaque_one_and_two_twin_ssePtr + .asFunction, int, int)>(); + + void wire_rust_auto_opaque_return_opaque_two_twin_sse( + int port_, + ffi.Pointer ptr_, + int rust_vec_len_, + int data_len_, + ) { + return _wire_rust_auto_opaque_return_opaque_two_twin_sse( + port_, + ptr_, + rust_vec_len_, + data_len_, + ); + } + + late final _wire_rust_auto_opaque_return_opaque_two_twin_ssePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer, ffi.Int32, ffi.Int32)>>( + 'frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_sse'); + late final _wire_rust_auto_opaque_return_opaque_two_twin_sse = + _wire_rust_auto_opaque_return_opaque_two_twin_ssePtr + .asFunction, int, int)>(); + void wire_rust_auto_opaque_return_own_twin_sse( int port_, ffi.Pointer ptr_, @@ -50640,6 +51042,29 @@ class RustLibWire implements BaseWire { _wire_rust_auto_opaque_plus_sign_return_twin_syncPtr .asFunction(); + WireSyncRust2DartDco + wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync() { + return _wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync(); + } + + late final _wire_rust_auto_opaque_return_opaque_one_and_two_twin_syncPtr = + _lookup>( + 'frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync'); + late final _wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync = + _wire_rust_auto_opaque_return_opaque_one_and_two_twin_syncPtr + .asFunction(); + + WireSyncRust2DartDco wire_rust_auto_opaque_return_opaque_two_twin_sync() { + return _wire_rust_auto_opaque_return_opaque_two_twin_sync(); + } + + late final _wire_rust_auto_opaque_return_opaque_two_twin_syncPtr = _lookup< + ffi.NativeFunction>( + 'frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_sync'); + late final _wire_rust_auto_opaque_return_opaque_two_twin_sync = + _wire_rust_auto_opaque_return_opaque_two_twin_syncPtr + .asFunction(); + WireSyncRust2DartDco wire_rust_auto_opaque_return_own_twin_sync( int initial, ) { @@ -51292,6 +51717,52 @@ class RustLibWire implements BaseWire { _wire_rust_auto_opaque_plus_sign_return_twin_sync_ssePtr.asFunction< WireSyncRust2DartSse Function(ffi.Pointer, int, int)>(); + WireSyncRust2DartSse + wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse( + ffi.Pointer ptr_, + int rust_vec_len_, + int data_len_, + ) { + return _wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse( + ptr_, + rust_vec_len_, + data_len_, + ); + } + + late final _wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_ssePtr = + _lookup< + ffi.NativeFunction< + WireSyncRust2DartSse Function( + ffi.Pointer, ffi.Int32, ffi.Int32)>>( + 'frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse'); + late final _wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse = + _wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_ssePtr + .asFunction< + WireSyncRust2DartSse Function( + ffi.Pointer, int, int)>(); + + WireSyncRust2DartSse wire_rust_auto_opaque_return_opaque_two_twin_sync_sse( + ffi.Pointer ptr_, + int rust_vec_len_, + int data_len_, + ) { + return _wire_rust_auto_opaque_return_opaque_two_twin_sync_sse( + ptr_, + rust_vec_len_, + data_len_, + ); + } + + late final _wire_rust_auto_opaque_return_opaque_two_twin_sync_ssePtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartSse Function( + ffi.Pointer, ffi.Int32, ffi.Int32)>>( + 'frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_sync_sse'); + late final _wire_rust_auto_opaque_return_opaque_two_twin_sync_sse = + _wire_rust_auto_opaque_return_opaque_two_twin_sync_ssePtr.asFunction< + WireSyncRust2DartSse Function(ffi.Pointer, int, int)>(); + WireSyncRust2DartSse wire_rust_auto_opaque_return_own_twin_sync_sse( ffi.Pointer ptr_, int rust_vec_len_, @@ -55329,6 +55800,36 @@ class RustLibWire implements BaseWire { _wire_rust_auto_opaque_plus_sign_return_twin_normalPtr .asFunction(); + void wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal( + int port_, + ) { + return _wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal( + port_, + ); + } + + late final _wire_rust_auto_opaque_return_opaque_one_and_two_twin_normalPtr = + _lookup>( + 'frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal'); + late final _wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal = + _wire_rust_auto_opaque_return_opaque_one_and_two_twin_normalPtr + .asFunction(); + + void wire_rust_auto_opaque_return_opaque_two_twin_normal( + int port_, + ) { + return _wire_rust_auto_opaque_return_opaque_two_twin_normal( + port_, + ); + } + + late final _wire_rust_auto_opaque_return_opaque_two_twin_normalPtr = _lookup< + ffi.NativeFunction>( + 'frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_normal'); + late final _wire_rust_auto_opaque_return_opaque_two_twin_normal = + _wire_rust_auto_opaque_return_opaque_two_twin_normalPtr + .asFunction(); + void wire_rust_auto_opaque_return_own_twin_normal( int port_, int initial, @@ -57241,6 +57742,262 @@ class RustLibWire implements BaseWire { _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSsePtr .asFunction)>(); + void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSsePtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse'); + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse = + _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSsePtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSsePtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse'); + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse = + _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSsePtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSsePtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse'); + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse = + _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSsePtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSsePtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse'); + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse = + _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSsePtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSyncPtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync'); + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync = + _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSyncPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSyncPtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync'); + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync = + _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSyncPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSyncPtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync'); + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync = + _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSyncPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSyncPtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync'); + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync = + _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSyncPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSsePtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse'); + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse = + _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSsePtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSsePtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse'); + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse = + _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSsePtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSsePtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse'); + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse = + _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSsePtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSsePtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse'); + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse = + _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSsePtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormalPtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal'); + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal = + _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormalPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormalPtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal'); + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal = + _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormalPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormalPtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal'); + late final _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal = + _rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormalPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormalPtr = + _lookup)>>( + 'frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal'); + late final _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal = + _rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormalPtr + .asFunction)>(); + ffi.Pointer cst_new_box_application_env() { return _cst_new_box_application_env(); } diff --git a/frb_example/pure_dart/lib/src/rust/frb_generated.web.dart b/frb_example/pure_dart/lib/src/rust/frb_generated.web.dart index 0ebacb631e..92261e372e 100644 --- a/frb_example/pure_dart/lib/src/rust/frb_generated.web.dart +++ b/frb_example/pure_dart/lib/src/rust/frb_generated.web.dart @@ -336,6 +336,38 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { get rust_arc_decrement_strong_count_StructWithGoodAndOpaqueFieldTwinSyncSsePtr => wire.rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse; + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueOneTwinSseOpaqueTwoTwinSsePtr => + wire.rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueTwoTwinSsePtr => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueOneTwinSyncOpaqueTwoTwinSyncPtr => + wire.rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueTwoTwinSyncPtr => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSsePtr => + wire.rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueTwoTwinSyncSsePtr => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueOneTwinNormalOpaqueTwoTwinNormalPtr => + wire.rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OpaqueTwoTwinNormalPtr => wire + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal; + @protected AnyhowException dco_decode_AnyhowException(dynamic raw); @@ -424,6 +456,46 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse( dynamic raw); + @protected + OpaqueOneTwinSseOpaqueTwoTwinSse + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic raw); + + @protected + OpaqueTwoTwinSse + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic raw); + + @protected + OpaqueOneTwinSyncOpaqueTwoTwinSync + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic raw); + + @protected + OpaqueTwoTwinSync + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic raw); + + @protected + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic raw); + + @protected + OpaqueTwoTwinSyncSse + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic raw); + + @protected + OpaqueOneTwinNormalOpaqueTwoTwinNormal + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic raw); + + @protected + OpaqueTwoTwinNormal + dco_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic raw); + @protected BoxHelloTraitTwinNormal dco_decode_Auto_RefMut_RustOpaque_stdsyncRwLockBoxdynHelloTraitTwinNormal( @@ -758,6 +830,46 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { dco_decode_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse( dynamic raw); + @protected + OpaqueOneTwinSseOpaqueTwoTwinSse + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic raw); + + @protected + OpaqueTwoTwinSse + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic raw); + + @protected + OpaqueOneTwinSyncOpaqueTwoTwinSync + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic raw); + + @protected + OpaqueTwoTwinSync + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic raw); + + @protected + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic raw); + + @protected + OpaqueTwoTwinSyncSse + dco_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic raw); + + @protected + OpaqueOneTwinNormalOpaqueTwoTwinNormal + dco_decode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic raw); + + @protected + OpaqueTwoTwinNormal + dco_decode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic raw); + @protected String dco_decode_String(dynamic raw); @@ -4447,6 +4559,46 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse( SseDeserializer deserializer); + @protected + OpaqueOneTwinSseOpaqueTwoTwinSse + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinSse + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + SseDeserializer deserializer); + + @protected + OpaqueOneTwinSyncOpaqueTwoTwinSync + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinSync + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + SseDeserializer deserializer); + + @protected + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinSyncSse + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + SseDeserializer deserializer); + + @protected + OpaqueOneTwinNormalOpaqueTwoTwinNormal + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinNormal + sse_decode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + SseDeserializer deserializer); + @protected BoxHelloTraitTwinNormal sse_decode_Auto_RefMut_RustOpaque_stdsyncRwLockBoxdynHelloTraitTwinNormal( @@ -4732,6 +4884,46 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { sse_decode_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse( SseDeserializer deserializer); + @protected + OpaqueOneTwinSseOpaqueTwoTwinSse + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinSse + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + SseDeserializer deserializer); + + @protected + OpaqueOneTwinSyncOpaqueTwoTwinSync + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinSync + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + SseDeserializer deserializer); + + @protected + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinSyncSse + sse_decode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + SseDeserializer deserializer); + + @protected + OpaqueOneTwinNormalOpaqueTwoTwinNormal + sse_decode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + SseDeserializer deserializer); + + @protected + OpaqueTwoTwinNormal + sse_decode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + SseDeserializer deserializer); + @protected String sse_decode_String(SseDeserializer deserializer); @@ -16369,6 +16561,46 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse( StructWithGoodAndOpaqueFieldTwinSyncSse raw); + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueOneTwinSseOpaqueTwoTwinSse raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueTwoTwinSse raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueOneTwinSyncOpaqueTwoTwinSync raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueTwoTwinSync raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueTwoTwinSyncSse raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueOneTwinNormalOpaqueTwoTwinNormal raw); + + @protected + PlatformPointer + cst_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueTwoTwinNormal raw); + @protected PlatformPointer cst_encode_Auto_RefMut_RustOpaque_stdsyncRwLockBoxdynHelloTraitTwinNormal( @@ -16693,6 +16925,46 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { cst_encode_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse( StructWithGoodAndOpaqueFieldTwinSyncSse raw); + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueOneTwinSseOpaqueTwoTwinSse raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueTwoTwinSse raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueOneTwinSyncOpaqueTwoTwinSync raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueTwoTwinSync raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueTwoTwinSyncSse raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueOneTwinNormalOpaqueTwoTwinNormal raw); + + @protected + PlatformPointer + cst_encode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueTwoTwinNormal raw); + @protected int cst_encode_application_mode(ApplicationMode raw); @@ -16856,6 +17128,48 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { StructWithGoodAndOpaqueFieldTwinSyncSse self, SseSerializer serializer); + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueOneTwinSseOpaqueTwoTwinSse self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueTwoTwinSse self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueOneTwinSyncOpaqueTwoTwinSync self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueTwoTwinSync self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse self, + SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueTwoTwinSyncSse self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueOneTwinNormalOpaqueTwoTwinNormal self, + SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueTwoTwinNormal self, SseSerializer serializer); + @protected void sse_encode_Auto_RefMut_RustOpaque_stdsyncRwLockBoxdynHelloTraitTwinNormal( @@ -17200,6 +17514,48 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { StructWithGoodAndOpaqueFieldTwinSyncSse self, SseSerializer serializer); + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueOneTwinSseOpaqueTwoTwinSse self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + OpaqueTwoTwinSse self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueOneTwinSyncOpaqueTwoTwinSync self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + OpaqueTwoTwinSync self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueOneTwinSyncSseOpaqueTwoTwinSyncSse self, + SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + OpaqueTwoTwinSyncSse self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueOneTwinNormalOpaqueTwoTwinNormal self, + SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + OpaqueTwoTwinNormal self, SseSerializer serializer); + @protected void sse_encode_String(String self, SseSerializer serializer); @@ -28479,6 +28835,22 @@ class RustLibWire extends BaseWire { wasmModule.wire_rust_auto_opaque_plus_sign_return_twin_sse( port_, ptr_, rust_vec_len_, data_len_); + void wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse( + NativePortType port_, + PlatformGeneralizedUint8ListPtr ptr_, + int rust_vec_len_, + int data_len_) => + wasmModule.wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse( + port_, ptr_, rust_vec_len_, data_len_); + + void wire_rust_auto_opaque_return_opaque_two_twin_sse( + NativePortType port_, + PlatformGeneralizedUint8ListPtr ptr_, + int rust_vec_len_, + int data_len_) => + wasmModule.wire_rust_auto_opaque_return_opaque_two_twin_sse( + port_, ptr_, rust_vec_len_, data_len_); + void wire_rust_auto_opaque_return_own_twin_sse( NativePortType port_, PlatformGeneralizedUint8ListPtr ptr_, @@ -28676,6 +29048,14 @@ class RustLibWire extends BaseWire { wire_rust_auto_opaque_plus_sign_return_twin_sync() => wasmModule.wire_rust_auto_opaque_plus_sign_return_twin_sync(); + dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartDco */ + wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync() => wasmModule + .wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync(); + + dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartDco */ + wire_rust_auto_opaque_return_opaque_two_twin_sync() => + wasmModule.wire_rust_auto_opaque_return_opaque_two_twin_sync(); + dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartDco */ wire_rust_auto_opaque_return_own_twin_sync(int initial) => wasmModule.wire_rust_auto_opaque_return_own_twin_sync(initial); @@ -28909,6 +29289,23 @@ class RustLibWire extends BaseWire { wasmModule.wire_rust_auto_opaque_plus_sign_return_twin_sync_sse( ptr_, rust_vec_len_, data_len_); + dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartSse */ + wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse( + PlatformGeneralizedUint8ListPtr ptr_, + int rust_vec_len_, + int data_len_) => + wasmModule + .wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse( + ptr_, rust_vec_len_, data_len_); + + dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartSse */ + wire_rust_auto_opaque_return_opaque_two_twin_sync_sse( + PlatformGeneralizedUint8ListPtr ptr_, + int rust_vec_len_, + int data_len_) => + wasmModule.wire_rust_auto_opaque_return_opaque_two_twin_sync_sse( + ptr_, rust_vec_len_, data_len_); + dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartSse */ wire_rust_auto_opaque_return_own_twin_sync_sse( PlatformGeneralizedUint8ListPtr ptr_, @@ -30147,6 +30544,15 @@ class RustLibWire extends BaseWire { NativePortType port_) => wasmModule.wire_rust_auto_opaque_plus_sign_return_twin_normal(port_); + void wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal( + NativePortType port_) => + wasmModule + .wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal(port_); + + void wire_rust_auto_opaque_return_opaque_two_twin_normal( + NativePortType port_) => + wasmModule.wire_rust_auto_opaque_return_opaque_two_twin_normal(port_); + void wire_rust_auto_opaque_return_own_twin_normal( NativePortType port_, int initial) => wasmModule.wire_rust_auto_opaque_return_own_twin_normal(port_, initial); @@ -30699,6 +31105,102 @@ class RustLibWire extends BaseWire { wasmModule .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse( ptr); + + void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr); + + void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr); + + void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr); + + void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr); + + void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr); + + void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr); + + void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr); + + void rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic ptr) => + wasmModule + .rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr); + + void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic ptr) => + wasmModule + .rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr); } @JS('wasm_bindgen') @@ -35543,6 +36045,18 @@ class RustLibWasmModule implements WasmModule { int rust_vec_len_, int data_len_); + external void wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse( + NativePortType port_, + PlatformGeneralizedUint8ListPtr ptr_, + int rust_vec_len_, + int data_len_); + + external void wire_rust_auto_opaque_return_opaque_two_twin_sse( + NativePortType port_, + PlatformGeneralizedUint8ListPtr ptr_, + int rust_vec_len_, + int data_len_); + external void wire_rust_auto_opaque_return_own_twin_sse(NativePortType port_, PlatformGeneralizedUint8ListPtr ptr_, int rust_vec_len_, int data_len_); @@ -35674,6 +36188,12 @@ class RustLibWasmModule implements WasmModule { external dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartDco */ wire_rust_auto_opaque_plus_sign_return_twin_sync(); + external dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartDco */ + wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync(); + + external dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartDco */ + wire_rust_auto_opaque_return_opaque_two_twin_sync(); + external dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartDco */ wire_rust_auto_opaque_return_own_twin_sync(int initial); @@ -35833,6 +36353,18 @@ class RustLibWasmModule implements WasmModule { int rust_vec_len_, int data_len_); + external dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartSse */ + wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse( + PlatformGeneralizedUint8ListPtr ptr_, + int rust_vec_len_, + int data_len_); + + external dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartSse */ + wire_rust_auto_opaque_return_opaque_two_twin_sync_sse( + PlatformGeneralizedUint8ListPtr ptr_, + int rust_vec_len_, + int data_len_); + external dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartSse */ wire_rust_auto_opaque_return_own_twin_sync_sse( PlatformGeneralizedUint8ListPtr ptr_, @@ -36611,6 +37143,12 @@ class RustLibWasmModule implements WasmModule { external void wire_rust_auto_opaque_plus_sign_return_twin_normal( NativePortType port_); + external void wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal( + NativePortType port_); + + external void wire_rust_auto_opaque_return_opaque_two_twin_normal( + NativePortType port_); + external void wire_rust_auto_opaque_return_own_twin_normal( NativePortType port_, int initial); @@ -36998,4 +37536,68 @@ class RustLibWasmModule implements WasmModule { external void rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockStructWithGoodAndOpaqueFieldTwinSyncSse( dynamic ptr); + + external void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic ptr); + + external void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic ptr); + + external void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic ptr); + + external void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + dynamic ptr); + + external void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic ptr); + + external void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic ptr); + + external void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic ptr); + + external void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + dynamic ptr); + + external void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic ptr); + + external void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic ptr); + + external void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic ptr); + + external void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + dynamic ptr); + + external void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic ptr); + + external void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic ptr); + + external void + rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic ptr); + + external void + rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + dynamic ptr); } diff --git a/frb_example/pure_dart/rust/src/frb_generated.io.rs b/frb_example/pure_dart/rust/src/frb_generated.io.rs index 4290ac282f..e3967ada11 100644 --- a/frb_example/pure_dart/rust/src/frb_generated.io.rs +++ b/frb_example/pure_dart/rust/src/frb_generated.io.rs @@ -347,6 +347,158 @@ impl unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } } } +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueOneTwinSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + )>, + >, + > for *const std::ffi::c_void +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueOneTwinSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + )>, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + >, + >, + > for *const std::ffi::c_void +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueOneTwinSync, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + )>, + >, + > for *const std::ffi::c_void +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueOneTwinSync, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + )>, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + >, + >, + > for *const std::ffi::c_void +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueOneTwinSyncSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + )>, + >, + > for *const std::ffi::c_void +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueOneTwinSyncSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + )>, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + >, + >, + > for *const std::ffi::c_void +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + >, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::rust_auto_opaque::OpaqueOneTwinNormal, + crate::api::rust_auto_opaque::OpaqueTwoTwinNormal, + )>, + >, + > for *const std::ffi::c_void +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::rust_auto_opaque::OpaqueOneTwinNormal, + crate::api::rust_auto_opaque::OpaqueTwoTwinNormal, + )>, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock, + >, + > for *const std::ffi::c_void +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} impl CstDecode for *mut wire_cst_list_prim_u_8 { fn cst_decode(self) -> String { let vec: Vec = self.cst_decode(); @@ -26990,6 +27142,31 @@ pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_plus_sign_r wire_rust_auto_opaque_plus_sign_return_twin_sse_impl(port_, ptr_, rust_vec_len_, data_len_) } +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse( + port_: i64, + ptr_: *mut u8, + rust_vec_len_: i32, + data_len_: i32, +) { + wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse_impl( + port_, + ptr_, + rust_vec_len_, + data_len_, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_sse( + port_: i64, + ptr_: *mut u8, + rust_vec_len_: i32, + data_len_: i32, +) { + wire_rust_auto_opaque_return_opaque_two_twin_sse_impl(port_, ptr_, rust_vec_len_, data_len_) +} + #[no_mangle] pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_own_twin_sse( port_: i64, @@ -27279,6 +27456,18 @@ pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_plus_sign_r wire_rust_auto_opaque_plus_sign_return_twin_sync_impl() } +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync( +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_impl() +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_sync( +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_rust_auto_opaque_return_opaque_two_twin_sync_impl() +} + #[no_mangle] pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_own_twin_sync( initial: i32, @@ -27577,6 +27766,28 @@ pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_plus_sign_r wire_rust_auto_opaque_plus_sign_return_twin_sync_sse_impl(ptr_, rust_vec_len_, data_len_) } +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse( + ptr_: *mut u8, + rust_vec_len_: i32, + data_len_: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse_impl( + ptr_, + rust_vec_len_, + data_len_, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_sync_sse( + ptr_: *mut u8, + rust_vec_len_: i32, + data_len_: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + wire_rust_auto_opaque_return_opaque_two_twin_sync_sse_impl(ptr_, rust_vec_len_, data_len_) +} + #[no_mangle] pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_own_twin_sync_sse( ptr_: *mut u8, @@ -29349,6 +29560,20 @@ pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_plus_sign_r wire_rust_auto_opaque_plus_sign_return_twin_normal_impl(port_) } +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal( + port_: i64, +) { + wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal_impl(port_) +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_opaque_two_twin_normal( + port_: i64, +) { + wire_rust_auto_opaque_return_opaque_two_twin_normal_impl(port_) +} + #[no_mangle] pub extern "C" fn frbgen_frb_example_pure_dart_wire_rust_auto_opaque_return_own_twin_normal( port_: i64, @@ -30430,6 +30655,218 @@ pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_R } } +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueOneTwinSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + )>, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueOneTwinSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + )>, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + >, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + >, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueOneTwinSync, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + )>, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueOneTwinSync, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + )>, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + >, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + >, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueOneTwinSyncSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + )>, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueOneTwinSyncSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + )>, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + >, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + >, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock<( + crate::api::rust_auto_opaque::OpaqueOneTwinNormal, + crate::api::rust_auto_opaque::OpaqueTwoTwinNormal, + )>, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock<( + crate::api::rust_auto_opaque::OpaqueOneTwinNormal, + crate::api::rust_auto_opaque::OpaqueTwoTwinNormal, + )>, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock, + >(ptr); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock, + >(ptr); + } +} + #[no_mangle] pub extern "C" fn frbgen_frb_example_pure_dart_cst_new_box_application_env( ) -> *mut wire_cst_application_env { diff --git a/frb_example/pure_dart/rust/src/frb_generated.rs b/frb_example/pure_dart/rust/src/frb_generated.rs index a50afa648c..0f54b03036 100644 --- a/frb_example/pure_dart/rust/src/frb_generated.rs +++ b/frb_example/pure_dart/rust/src/frb_generated.rs @@ -18771,6 +18771,36 @@ fn wire_rust_auto_opaque_plus_sign_return_twin_sse_impl( })()) } }) } +fn wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "rust_auto_opaque_return_opaque_one_and_two_twin_sse", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || { + let message = unsafe { flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(ptr_, rust_vec_len_, data_len_) }; + let mut deserializer = flutter_rust_bridge::for_generated::SseDeserializer::new(message); + deserializer.end(); move |context| { + transform_result_sse((move || { + Result::<_,()>::Ok(flutter_rust_bridge::for_generated::rust_auto_opaque_encode(crate::api::pseudo_manual::rust_auto_opaque_twin_sse::rust_auto_opaque_return_opaque_one_and_two_twin_sse())) + })()) + } }) +} +fn wire_rust_auto_opaque_return_opaque_two_twin_sse_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "rust_auto_opaque_return_opaque_two_twin_sse", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || { + let message = unsafe { flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(ptr_, rust_vec_len_, data_len_) }; + let mut deserializer = flutter_rust_bridge::for_generated::SseDeserializer::new(message); + deserializer.end(); move |context| { + transform_result_sse((move || { + Result::<_,()>::Ok(flutter_rust_bridge::for_generated::rust_auto_opaque_encode(crate::api::pseudo_manual::rust_auto_opaque_twin_sse::rust_auto_opaque_return_opaque_two_twin_sse())) + })()) + } }) +} fn wire_rust_auto_opaque_return_own_twin_sse_impl( port_: flutter_rust_bridge::for_generated::MessagePort, ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, @@ -19127,6 +19157,20 @@ fn wire_rust_auto_opaque_plus_sign_return_twin_sync_impl( Result::<_,()>::Ok(flutter_rust_bridge::for_generated::rust_auto_opaque_encode(crate::api::pseudo_manual::rust_auto_opaque_twin_sync::rust_auto_opaque_plus_sign_return_twin_sync())) })()) }) } +fn wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_impl( +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "rust_auto_opaque_return_opaque_one_and_two_twin_sync", port: None, mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync }, move || { + transform_result_dco((move || { + Result::<_,()>::Ok(flutter_rust_bridge::for_generated::rust_auto_opaque_encode(crate::api::pseudo_manual::rust_auto_opaque_twin_sync::rust_auto_opaque_return_opaque_one_and_two_twin_sync())) + })()) }) +} +fn wire_rust_auto_opaque_return_opaque_two_twin_sync_impl( +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "rust_auto_opaque_return_opaque_two_twin_sync", port: None, mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync }, move || { + transform_result_dco((move || { + Result::<_,()>::Ok(flutter_rust_bridge::for_generated::rust_auto_opaque_encode(crate::api::pseudo_manual::rust_auto_opaque_twin_sync::rust_auto_opaque_return_opaque_two_twin_sync())) + })()) }) +} fn wire_rust_auto_opaque_return_own_twin_sync_impl( initial: impl CstDecode, ) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { @@ -19509,6 +19553,32 @@ fn wire_rust_auto_opaque_plus_sign_return_twin_sync_sse_impl( Result::<_,()>::Ok(flutter_rust_bridge::for_generated::rust_auto_opaque_encode(crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::rust_auto_opaque_plus_sign_return_twin_sync_sse())) })()) }) } +fn wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse_impl( + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse", port: None, mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync }, move || { + let message = unsafe { flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(ptr_, rust_vec_len_, data_len_) }; + let mut deserializer = flutter_rust_bridge::for_generated::SseDeserializer::new(message); + deserializer.end(); + transform_result_sse((move || { + Result::<_,()>::Ok(flutter_rust_bridge::for_generated::rust_auto_opaque_encode(crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse())) + })()) }) +} +fn wire_rust_auto_opaque_return_opaque_two_twin_sync_sse_impl( + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "rust_auto_opaque_return_opaque_two_twin_sync_sse", port: None, mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync }, move || { + let message = unsafe { flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(ptr_, rust_vec_len_, data_len_) }; + let mut deserializer = flutter_rust_bridge::for_generated::SseDeserializer::new(message); + deserializer.end(); + transform_result_sse((move || { + Result::<_,()>::Ok(flutter_rust_bridge::for_generated::rust_auto_opaque_encode(crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::rust_auto_opaque_return_opaque_two_twin_sync_sse())) + })()) }) +} fn wire_rust_auto_opaque_return_own_twin_sync_sse_impl( ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, rust_vec_len_: i32, @@ -22711,6 +22781,24 @@ fn wire_rust_auto_opaque_plus_sign_return_twin_normal_impl( })()) } }) } +fn wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "rust_auto_opaque_return_opaque_one_and_two_twin_normal", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || { move |context| { + transform_result_dco((move || { + Result::<_,()>::Ok(flutter_rust_bridge::for_generated::rust_auto_opaque_encode(crate::api::rust_auto_opaque::rust_auto_opaque_return_opaque_one_and_two_twin_normal())) + })()) + } }) +} +fn wire_rust_auto_opaque_return_opaque_two_twin_normal_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "rust_auto_opaque_return_opaque_two_twin_normal", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || { move |context| { + transform_result_dco((move || { + Result::<_,()>::Ok(flutter_rust_bridge::for_generated::rust_auto_opaque_encode(crate::api::rust_auto_opaque::rust_auto_opaque_return_opaque_two_twin_normal())) + })()) + } }) +} fn wire_rust_auto_opaque_return_own_twin_normal_impl( port_: flutter_rust_bridge::for_generated::MessagePort, initial: impl CstDecode, @@ -24819,6 +24907,108 @@ impl SseDecode } } +impl SseDecode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueOneTwinSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + )>, + > +{ + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { flutter_rust_bridge::for_generated::sse_decode_rust_opaque(inner) }; + } +} + +impl SseDecode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock, + > +{ + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { flutter_rust_bridge::for_generated::sse_decode_rust_opaque(inner) }; + } +} + +impl SseDecode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueOneTwinSync, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + )>, + > +{ + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { flutter_rust_bridge::for_generated::sse_decode_rust_opaque(inner) }; + } +} + +impl SseDecode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock, + > +{ + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { flutter_rust_bridge::for_generated::sse_decode_rust_opaque(inner) }; + } +} + +impl SseDecode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueOneTwinSyncSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + )>, + > +{ + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { flutter_rust_bridge::for_generated::sse_decode_rust_opaque(inner) }; + } +} + +impl SseDecode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + >, + > +{ + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { flutter_rust_bridge::for_generated::sse_decode_rust_opaque(inner) }; + } +} + +impl SseDecode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::rust_auto_opaque::OpaqueOneTwinNormal, + crate::api::rust_auto_opaque::OpaqueTwoTwinNormal, + )>, + > +{ + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { flutter_rust_bridge::for_generated::sse_decode_rust_opaque(inner) }; + } +} + +impl SseDecode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock, + > +{ + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { flutter_rust_bridge::for_generated::sse_decode_rust_opaque(inner) }; + } +} + impl SseDecode for String { fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { let mut inner = >::sse_decode(deserializer); @@ -44642,6 +44832,116 @@ impl SseEncode } } +impl SseEncode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueOneTwinSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + )>, + > +{ + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock, + > +{ + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueOneTwinSync, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + )>, + > +{ + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock, + > +{ + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueOneTwinSyncSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + )>, + > +{ + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + >, + > +{ + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::rust_auto_opaque::OpaqueOneTwinNormal, + crate::api::rust_auto_opaque::OpaqueTwoTwinNormal, + )>, + > +{ + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for flutter_rust_bridge::RustOpaque< + std::sync::RwLock, + > +{ + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + impl SseEncode for String { fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { >::sse_encode(self.into_bytes(), serializer); diff --git a/frb_example/pure_dart/rust/src/frb_generated.web.rs b/frb_example/pure_dart/rust/src/frb_generated.web.rs index 31d2f26397..9b625dfcbe 100644 --- a/frb_example/pure_dart/rust/src/frb_generated.web.rs +++ b/frb_example/pure_dart/rust/src/frb_generated.web.rs @@ -9151,6 +9151,158 @@ impl unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } } } +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueOneTwinSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + )>, + >, + > for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueOneTwinSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + )>, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + >, + >, + > for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueOneTwinSync, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + )>, + >, + > for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueOneTwinSync, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + )>, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + >, + >, + > for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueOneTwinSyncSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + )>, + >, + > for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueOneTwinSyncSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + )>, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + >, + >, + > for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + >, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::rust_auto_opaque::OpaqueOneTwinNormal, + crate::api::rust_auto_opaque::OpaqueTwoTwinNormal, + )>, + >, + > for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock<( + crate::api::rust_auto_opaque::OpaqueOneTwinNormal, + crate::api::rust_auto_opaque::OpaqueTwoTwinNormal, + )>, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} +impl + CstDecode< + flutter_rust_bridge::RustOpaque< + std::sync::RwLock, + >, + > for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue +{ + fn cst_decode( + self, + ) -> flutter_rust_bridge::RustOpaque< + std::sync::RwLock, + > { + unsafe { flutter_rust_bridge::for_generated::cst_decode_rust_opaque(self) } + } +} impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { fn cst_decode(self) -> String { self.as_string().expect("non-UTF-8 string, or not a string") @@ -21220,6 +21372,31 @@ pub fn wire_rust_auto_opaque_plus_sign_return_twin_sse( wire_rust_auto_opaque_plus_sign_return_twin_sse_impl(port_, ptr_, rust_vec_len_, data_len_) } +#[wasm_bindgen] +pub fn wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) { + wire_rust_auto_opaque_return_opaque_one_and_two_twin_sse_impl( + port_, + ptr_, + rust_vec_len_, + data_len_, + ) +} + +#[wasm_bindgen] +pub fn wire_rust_auto_opaque_return_opaque_two_twin_sse( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) { + wire_rust_auto_opaque_return_opaque_two_twin_sse_impl(port_, ptr_, rust_vec_len_, data_len_) +} + #[wasm_bindgen] pub fn wire_rust_auto_opaque_return_own_twin_sse( port_: flutter_rust_bridge::for_generated::MessagePort, @@ -21509,6 +21686,18 @@ pub fn wire_rust_auto_opaque_plus_sign_return_twin_sync( wire_rust_auto_opaque_plus_sign_return_twin_sync_impl() } +#[wasm_bindgen] +pub fn wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync( +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_impl() +} + +#[wasm_bindgen] +pub fn wire_rust_auto_opaque_return_opaque_two_twin_sync( +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_rust_auto_opaque_return_opaque_two_twin_sync_impl() +} + #[wasm_bindgen] pub fn wire_rust_auto_opaque_return_own_twin_sync( initial: i32, @@ -21807,6 +21996,28 @@ pub fn wire_rust_auto_opaque_plus_sign_return_twin_sync_sse( wire_rust_auto_opaque_plus_sign_return_twin_sync_sse_impl(ptr_, rust_vec_len_, data_len_) } +#[wasm_bindgen] +pub fn wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse( + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + wire_rust_auto_opaque_return_opaque_one_and_two_twin_sync_sse_impl( + ptr_, + rust_vec_len_, + data_len_, + ) +} + +#[wasm_bindgen] +pub fn wire_rust_auto_opaque_return_opaque_two_twin_sync_sse( + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + wire_rust_auto_opaque_return_opaque_two_twin_sync_sse_impl(ptr_, rust_vec_len_, data_len_) +} + #[wasm_bindgen] pub fn wire_rust_auto_opaque_return_own_twin_sync_sse( ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, @@ -23580,6 +23791,20 @@ pub fn wire_rust_auto_opaque_plus_sign_return_twin_normal( wire_rust_auto_opaque_plus_sign_return_twin_normal_impl(port_) } +#[wasm_bindgen] +pub fn wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal( + port_: flutter_rust_bridge::for_generated::MessagePort, +) { + wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal_impl(port_) +} + +#[wasm_bindgen] +pub fn wire_rust_auto_opaque_return_opaque_two_twin_normal( + port_: flutter_rust_bridge::for_generated::MessagePort, +) { + wire_rust_auto_opaque_return_opaque_two_twin_normal_impl(port_) +} + #[wasm_bindgen] pub fn wire_rust_auto_opaque_return_own_twin_normal( port_: flutter_rust_bridge::for_generated::MessagePort, @@ -24634,3 +24859,215 @@ pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockStructWithGoodAnd >(ptr); } } + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueOneTwinSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + )>, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueOneTwinSsecrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueOneTwinSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + )>, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + >, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sseOpaqueTwoTwinSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sse::OpaqueTwoTwinSse, + >, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueOneTwinSync, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + )>, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueOneTwinSynccrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueOneTwinSync, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + )>, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + >, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_syncOpaqueTwoTwinSync( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync::OpaqueTwoTwinSync, + >, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueOneTwinSyncSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + )>, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueOneTwinSyncSsecrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock<( + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueOneTwinSyncSse, + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + )>, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + >, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapipseudo_manualrust_auto_opaque_twin_sync_sseOpaqueTwoTwinSyncSse( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock< + crate::api::pseudo_manual::rust_auto_opaque_twin_sync_sse::OpaqueTwoTwinSyncSse, + >, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock<( + crate::api::rust_auto_opaque::OpaqueOneTwinNormal, + crate::api::rust_auto_opaque::OpaqueTwoTwinNormal, + )>, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueOneTwinNormalcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock<( + crate::api::rust_auto_opaque::OpaqueOneTwinNormal, + crate::api::rust_auto_opaque::OpaqueTwoTwinNormal, + )>, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_increment_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_increment_strong_count::< + std::sync::RwLock, + >(ptr); + } +} + +#[wasm_bindgen] +pub fn rust_arc_decrement_strong_count_RustOpaque_stdsyncRwLockcrateapirust_auto_opaqueOpaqueTwoTwinNormal( + ptr: *const std::ffi::c_void, +) { + unsafe { + flutter_rust_bridge::for_generated::rust_arc_decrement_strong_count::< + std::sync::RwLock, + >(ptr); + } +} From cccf1d4c6b7081ff7390cfc64fbb47eed14f9b59 Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:31:47 +0800 Subject: [PATCH 12/17] feat: mv --- website/docs/guides/miscellaneous/upgrade/index.md | 7 +++++++ .../miscellaneous/{upgrade.md => upgrade/v2.md} | 0 website/sidebars.js | 13 ++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 website/docs/guides/miscellaneous/upgrade/index.md rename website/docs/guides/miscellaneous/{upgrade.md => upgrade/v2.md} (100%) diff --git a/website/docs/guides/miscellaneous/upgrade/index.md b/website/docs/guides/miscellaneous/upgrade/index.md new file mode 100644 index 0000000000..9f9c655471 --- /dev/null +++ b/website/docs/guides/miscellaneous/upgrade/index.md @@ -0,0 +1,7 @@ +# Upgrade + +```mdx-code-block +import DocCardList from '@theme/DocCardList'; + + +``` diff --git a/website/docs/guides/miscellaneous/upgrade.md b/website/docs/guides/miscellaneous/upgrade/v2.md similarity index 100% rename from website/docs/guides/miscellaneous/upgrade.md rename to website/docs/guides/miscellaneous/upgrade/v2.md diff --git a/website/sidebars.js b/website/sidebars.js index d789866cc8..9aa3f88265 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -187,7 +187,18 @@ const sidebars = { 'guides/miscellaneous/compatibility', 'guides/miscellaneous/deployment', 'guides/miscellaneous/whats-new', - 'guides/miscellaneous/upgrade', + { + type: 'category', + label: 'Upgrade', + collapsed: true, + link: { + type: 'doc', + id: 'guides/miscellaneous/upgrade/index', + }, + items: [ + 'guides/miscellaneous/upgrade/v2', + ], + }, ], }, { From 3a7794d2f8ac96c0662d5fb099e5e122ff319674 Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:32:43 +0800 Subject: [PATCH 13/17] feat: link --- website/docs/guides/miscellaneous/whats-new.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/guides/miscellaneous/whats-new.md b/website/docs/guides/miscellaneous/whats-new.md index ec16456e76..d9f9e6da0b 100644 --- a/website/docs/guides/miscellaneous/whats-new.md +++ b/website/docs/guides/miscellaneous/whats-new.md @@ -44,4 +44,4 @@ where there are lists of features (advantages) and a quick show-me-the-code. ## Upgrade guide -To upgrade, please refer to [the upgrade guide](upgrade). +To upgrade, please refer to [the upgrade guide](upgrade/v2). From a052055973099782e90e6587006c81ecf8c1584e Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:33:26 +0800 Subject: [PATCH 14/17] chore: doc --- website/docs/guides/miscellaneous/upgrade/v2.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/website/docs/guides/miscellaneous/upgrade/v2.md b/website/docs/guides/miscellaneous/upgrade/v2.md index dfc525d5da..7f28600b89 100644 --- a/website/docs/guides/miscellaneous/upgrade/v2.md +++ b/website/docs/guides/miscellaneous/upgrade/v2.md @@ -5,7 +5,7 @@ This guide shows how to upgrade a project using flutter_rust_bridge V1 to V2. ## Concrete commands and checklist :::info -This is just one approach, see below for more approaches +This is just one approach, see below for more approaches. ::: * Follow the [quickstart](../../quickstart) to integrate V2 boilerplate into the existing project (in a few commands). Usually, you just need to run `flutter_rust_bridge_codegen integrate`. @@ -16,13 +16,19 @@ This is just one approach, see below for more approaches ## Alternative approaches +
+ Surely, there are alternative approaches. For example, if you want to keep the compilation and integration between Rust and Dart, or like to use command line arguments, just find the corresponding counterparts in V2 and rename things. +
+ ## Changes and quick renames +
+ * `SyncReturn` type becomes annotation: Change `fn f() -> SyncReturn {}` to `#[frb(sync)] fn f() -> T {}` * `api.functionName()` -> `functionName()` * `DartAbi` -> `DartDynamic` (simple name alias) @@ -36,8 +42,12 @@ Some flags are removed, when, for example, they exist mainly for compatibility of later V1 with earlier V1 versions. If you find the removed flag important for your scenario, feel free to create an issue. +
+ ## Extra checklist for cleanup +
+ :::info Here are some concrete possibilities, which may or may not be your own case. This serves to check whether there are missing cleanup steps. @@ -60,3 +70,5 @@ This serves to check whether there are missing cleanup steps. * Remove `bridge_generated.h` from the "Copy Bundle Resources" build phase 2. Delete the `ios/Runner/libmyapp.a` and remove it from the "Link Binary With Libraries" build phase. 3. Remove the `print("dummy_value=\(dummy_method_to_enforce_bundling())");` line in `ios/Runner/AppDelegate.swift` if you had that workaround. + +
From 4e9f108dd2d00ce357a9fc19cf3476fb09aae6a8 Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:34:25 +0800 Subject: [PATCH 15/17] chore: empty --- website/docs/guides/miscellaneous/upgrade/regular.md | 2 ++ website/sidebars.js | 1 + 2 files changed, 3 insertions(+) create mode 100644 website/docs/guides/miscellaneous/upgrade/regular.md diff --git a/website/docs/guides/miscellaneous/upgrade/regular.md b/website/docs/guides/miscellaneous/upgrade/regular.md new file mode 100644 index 0000000000..8f5d1e5991 --- /dev/null +++ b/website/docs/guides/miscellaneous/upgrade/regular.md @@ -0,0 +1,2 @@ +# Regular upgrades + diff --git a/website/sidebars.js b/website/sidebars.js index 9aa3f88265..98a2b2ef83 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -197,6 +197,7 @@ const sidebars = { }, items: [ 'guides/miscellaneous/upgrade/v2', + 'guides/miscellaneous/upgrade/regular', ], }, ], From 4b3d3c29a8c6b774f18416064ca66db9e3d457de Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:38:45 +0800 Subject: [PATCH 16/17] feat: doc --- website/docs/guides/miscellaneous/upgrade/regular.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/docs/guides/miscellaneous/upgrade/regular.md b/website/docs/guides/miscellaneous/upgrade/regular.md index 8f5d1e5991..855a30921a 100644 --- a/website/docs/guides/miscellaneous/upgrade/regular.md +++ b/website/docs/guides/miscellaneous/upgrade/regular.md @@ -1,2 +1,7 @@ # Regular upgrades +Since the bridge consists of three components, we need to upgrade them together: + +1. **Code generator**: Run `cargo install 'flutter_rust_bridge_codegen@^2.0.0-dev.0'`, or use other installation methods mentioned in [the quickstart](../../../quickstart). +2. **Rust runtime**: Edit `Cargo.toml`, changing `flutter_rust_bridge = "=x.x.x"`. +3. **Dart runtime**: Edit `pubspec.yaml`, changing `flutter_rust_bridge: x.x.x`. From 533f5abd98d7cf631451f845ffa6eff3e7054910 Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Wed, 3 Jan 2024 09:57:53 +0800 Subject: [PATCH 17/17] fix: link --- website/docs/guides/miscellaneous/upgrade/v2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/guides/miscellaneous/upgrade/v2.md b/website/docs/guides/miscellaneous/upgrade/v2.md index 7f28600b89..41cdc5b0e3 100644 --- a/website/docs/guides/miscellaneous/upgrade/v2.md +++ b/website/docs/guides/miscellaneous/upgrade/v2.md @@ -8,7 +8,7 @@ This guide shows how to upgrade a project using flutter_rust_bridge V1 to V2. This is just one approach, see below for more approaches. ::: -* Follow the [quickstart](../../quickstart) to integrate V2 boilerplate into the existing project (in a few commands). Usually, you just need to run `flutter_rust_bridge_codegen integrate`. +* Follow the [quickstart](../../../quickstart) to integrate V2 boilerplate into the existing project (in a few commands). Usually, you just need to run `flutter_rust_bridge_codegen integrate`. * Move original Rust code (e.g. in `api.rs`) to `rust/src/api/simple.rs`. (You can also split into multiple files, e.g. `apple.rs`, `orange.rs`, etc.) * Run code generator and watch for code changes by running `flutter_rust_bridge_codegen generate --watch`. * Fix compilation errors (usually just a rename or relocation) and runtime exceptions (usually have hints).