diff --git a/frb_codegen/src/library/codegen/generator/wire/dart/spec_generator/codec/dco/decoder/ty/delegate.rs b/frb_codegen/src/library/codegen/generator/wire/dart/spec_generator/codec/dco/decoder/ty/delegate.rs index f8fa6cd990..eedbe69088 100644 --- a/frb_codegen/src/library/codegen/generator/wire/dart/spec_generator/codec/dco/decoder/ty/delegate.rs +++ b/frb_codegen/src/library/codegen/generator/wire/dart/spec_generator/codec/dco/decoder/ty/delegate.rs @@ -68,15 +68,7 @@ impl<'a> WireDartCodecDcoGeneratorDecoderTrait for DelegateWireDartCodecDcoGener IrTypeDelegate::Uuid => { "return UuidValue.fromByteList(dco_decode_list_prim_u_8_strict(raw));".to_owned() } - // IrTypeDelegate::Uuids => - // "const kUuidSizeInBytes = 16; - // final bytes = dco_decode_list_prim_u_8(raw); - // return List.generate( - // bytes.lengthInBytes ~/ kUuidSizeInBytes, - // (i) => UuidValue.fromByteList(Uint8List.view(bytes.buffer, i * kUuidSizeInBytes, kUuidSizeInBytes)), - // growable: false, - // ); - // ".to_owned(), + // IrTypeDelegate::Uuids => ..., IrTypeDelegate::AnyhowException => "return AnyhowException(raw as String);".to_owned(), IrTypeDelegate::Map(_) => format!( "return Map.fromEntries(dco_decode_{}(raw).map((e) => MapEntry(e.$1, e.$2)));", diff --git a/frb_codegen/src/library/codegen/generator/wire/dart/spec_generator/codec/dco/decoder/ty/general_list.rs b/frb_codegen/src/library/codegen/generator/wire/dart/spec_generator/codec/dco/decoder/ty/general_list.rs index 4cf6c69919..87df870e8d 100644 --- a/frb_codegen/src/library/codegen/generator/wire/dart/spec_generator/codec/dco/decoder/ty/general_list.rs +++ b/frb_codegen/src/library/codegen/generator/wire/dart/spec_generator/codec/dco/decoder/ty/general_list.rs @@ -1,9 +1,21 @@ use crate::codegen::generator::wire::dart::spec_generator::codec::dco::base::*; use crate::codegen::generator::wire::dart::spec_generator::codec::dco::decoder::ty::WireDartCodecDcoGeneratorDecoderTrait; +use crate::codegen::ir::ty::delegate::IrTypeDelegate; +use crate::codegen::ir::ty::IrType; use crate::library::codegen::ir::ty::IrTypeTrait; impl<'a> WireDartCodecDcoGeneratorDecoderTrait for GeneralListWireDartCodecDcoGenerator<'a> { fn generate_impl_decode_body(&self) -> String { + if let IrType::Delegate(IrTypeDelegate::Uuid) = &*self.ir.inner { + return "const kUuidSizeInBytes = 16; + final bytes = dco_decode_list_prim_u_8_strict(raw); + return List.generate( + bytes.lengthInBytes ~/ kUuidSizeInBytes, + (i) => UuidValue.fromByteList(Uint8List.view(bytes.buffer, i * kUuidSizeInBytes, kUuidSizeInBytes)), + growable: false, + );".to_owned(); + } + format!( "return (raw as List).map(dco_decode_{}).toList();", self.ir.inner.safe_ident() diff --git a/frb_codegen/src/library/codegen/generator/wire/rust/spec_generator/codec/cst/decoder/ty/general_list.rs b/frb_codegen/src/library/codegen/generator/wire/rust/spec_generator/codec/cst/decoder/ty/general_list.rs index 799043c7ac..13fa70ccd0 100644 --- a/frb_codegen/src/library/codegen/generator/wire/rust/spec_generator/codec/cst/decoder/ty/general_list.rs +++ b/frb_codegen/src/library/codegen/generator/wire/rust/spec_generator/codec/cst/decoder/ty/general_list.rs @@ -61,7 +61,10 @@ impl<'a> WireRustCodecCstGeneratorDecoderTrait for GeneralListWireRustCodecCstGe fn general_list_maybe_extra_pointer_indirection(ir: &IrTypeGeneralList) -> &'static str { if matches!( *ir.inner, - Optional(_) | Delegate(IrTypeDelegate::String) | IrType::PrimitiveList(_) + Optional(_) + | Delegate(IrTypeDelegate::String) + | Delegate(IrTypeDelegate::Uuid) + | IrType::PrimitiveList(_) ) { "*mut " } else { diff --git a/frb_example/pure_dart/frb_generated.h b/frb_example/pure_dart/frb_generated.h index 8c9e759ca3..23421a35eb 100644 --- a/frb_example/pure_dart/frb_generated.h +++ b/frb_example/pure_dart/frb_generated.h @@ -2280,6 +2280,11 @@ typedef struct wire_cst_feature_uuid_twin_rust_async { struct wire_cst_list_prim_u_8_strict *one; } wire_cst_feature_uuid_twin_rust_async; +typedef struct wire_cst_list_Uuid { + struct wire_cst_list_prim_u_8_strict **ptr; + int32_t len; +} wire_cst_list_Uuid; + typedef struct wire_cst_feature_uuid_twin_sync { struct wire_cst_list_prim_u_8_strict *one; } wire_cst_feature_uuid_twin_sync; @@ -11598,6 +11603,9 @@ void frbgen_frb_example_pure_dart_wire_handle_nested_uuids_twin_rust_async(int64 void frbgen_frb_example_pure_dart_wire_handle_uuid_twin_rust_async(int64_t port_, struct wire_cst_list_prim_u_8_strict *id); +void frbgen_frb_example_pure_dart_wire_handle_uuids_twin_rust_async(int64_t port_, + struct wire_cst_list_Uuid *ids); + void frbgen_frb_example_pure_dart_wire_handle_nested_uuids_twin_rust_async_sse(int64_t port_, uint8_t *ptr_, int32_t rust_vec_len_, @@ -11608,6 +11616,11 @@ void frbgen_frb_example_pure_dart_wire_handle_uuid_twin_rust_async_sse(int64_t p int32_t rust_vec_len_, int32_t data_len_); +void frbgen_frb_example_pure_dart_wire_handle_uuids_twin_rust_async_sse(int64_t port_, + uint8_t *ptr_, + int32_t rust_vec_len_, + int32_t data_len_); + void frbgen_frb_example_pure_dart_wire_handle_nested_uuids_twin_sse(int64_t port_, uint8_t *ptr_, int32_t rust_vec_len_, @@ -11618,10 +11631,17 @@ void frbgen_frb_example_pure_dart_wire_handle_uuid_twin_sse(int64_t port_, int32_t rust_vec_len_, int32_t data_len_); +void frbgen_frb_example_pure_dart_wire_handle_uuids_twin_sse(int64_t port_, + uint8_t *ptr_, + int32_t rust_vec_len_, + int32_t data_len_); + WireSyncRust2DartDco frbgen_frb_example_pure_dart_wire_handle_nested_uuids_twin_sync(struct wire_cst_feature_uuid_twin_sync *ids); WireSyncRust2DartDco frbgen_frb_example_pure_dart_wire_handle_uuid_twin_sync(struct wire_cst_list_prim_u_8_strict *id); +WireSyncRust2DartDco frbgen_frb_example_pure_dart_wire_handle_uuids_twin_sync(struct wire_cst_list_Uuid *ids); + WireSyncRust2DartSse frbgen_frb_example_pure_dart_wire_handle_nested_uuids_twin_sync_sse(uint8_t *ptr_, int32_t rust_vec_len_, int32_t data_len_); @@ -11630,6 +11650,10 @@ WireSyncRust2DartSse frbgen_frb_example_pure_dart_wire_handle_uuid_twin_sync_sse int32_t rust_vec_len_, int32_t data_len_); +WireSyncRust2DartSse frbgen_frb_example_pure_dart_wire_handle_uuids_twin_sync_sse(uint8_t *ptr_, + int32_t rust_vec_len_, + int32_t data_len_); + void frbgen_frb_example_pure_dart_wire_test_more_than_just_one_raw_string_struct_twin_normal(int64_t port_); void frbgen_frb_example_pure_dart_wire_test_raw_string_item_struct_twin_normal(int64_t port_); @@ -11876,6 +11900,9 @@ void frbgen_frb_example_pure_dart_wire_handle_nested_uuids_twin_normal(int64_t p void frbgen_frb_example_pure_dart_wire_handle_uuid_twin_normal(int64_t port_, struct wire_cst_list_prim_u_8_strict *id); +void frbgen_frb_example_pure_dart_wire_handle_uuids_twin_normal(int64_t port_, + struct wire_cst_list_Uuid *ids); + void frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_BoxdynDartDebugTwinMoi(const void *ptr); void frbgen_frb_example_pure_dart_rust_arc_decrement_strong_count_RustOpaque_BoxdynDartDebugTwinMoi(const void *ptr); @@ -13068,6 +13095,8 @@ struct wire_cst_list_RustOpaque_HideDataTwinSyncMoi *frbgen_frb_example_pure_dar struct wire_cst_list_String *frbgen_frb_example_pure_dart_cst_new_list_String(int32_t len); +struct wire_cst_list_Uuid *frbgen_frb_example_pure_dart_cst_new_list_Uuid(int32_t len); + struct wire_cst_list_application_env_var *frbgen_frb_example_pure_dart_cst_new_list_application_env_var(int32_t len); struct wire_cst_list_application_settings *frbgen_frb_example_pure_dart_cst_new_list_application_settings(int32_t len); @@ -13558,6 +13587,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_cst_new_list_RustOpaque_HideDataTwinSync); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_cst_new_list_RustOpaque_HideDataTwinSyncMoi); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_cst_new_list_String); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_cst_new_list_Uuid); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_cst_new_list_application_env_var); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_cst_new_list_application_settings); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_cst_new_list_attribute_twin_normal); @@ -15423,6 +15453,12 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_handle_uuid_twin_sse); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_handle_uuid_twin_sync); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_handle_uuid_twin_sync_sse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_handle_uuids_twin_normal); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_handle_uuids_twin_rust_async); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_handle_uuids_twin_rust_async_sse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_handle_uuids_twin_sse); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_handle_uuids_twin_sync); + dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_handle_uuids_twin_sync_sse); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_handle_vec_of_opts_twin_normal); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_handle_vec_of_opts_twin_rust_async); dummy_var ^= ((int64_t) (void*) frbgen_frb_example_pure_dart_wire_handle_vec_of_opts_twin_rust_async_sse); diff --git a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_rust_async.dart b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_rust_async.dart index 445f971884..374381c56a 100644 --- a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_rust_async.dart +++ b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_rust_async.dart @@ -11,6 +11,10 @@ Future handleUuidTwinRustAsync( {required UuidValue id, dynamic hint}) => RustLib.instance.api.handleUuidTwinRustAsync(id: id, hint: hint); +Future> handleUuidsTwinRustAsync( + {required List ids, dynamic hint}) => + RustLib.instance.api.handleUuidsTwinRustAsync(ids: ids, hint: hint); + Future handleNestedUuidsTwinRustAsync( {required FeatureUuidTwinRustAsync ids, dynamic hint}) => RustLib.instance.api.handleNestedUuidsTwinRustAsync(ids: ids, hint: hint); diff --git a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_rust_async_sse.dart b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_rust_async_sse.dart index 78e3a87f8f..658747f493 100644 --- a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_rust_async_sse.dart +++ b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_rust_async_sse.dart @@ -11,6 +11,10 @@ Future handleUuidTwinRustAsyncSse( {required UuidValue id, dynamic hint}) => RustLib.instance.api.handleUuidTwinRustAsyncSse(id: id, hint: hint); +Future> handleUuidsTwinRustAsyncSse( + {required List ids, dynamic hint}) => + RustLib.instance.api.handleUuidsTwinRustAsyncSse(ids: ids, hint: hint); + Future handleNestedUuidsTwinRustAsyncSse( {required FeatureUuidTwinRustAsyncSse ids, dynamic hint}) => RustLib.instance.api diff --git a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_sse.dart b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_sse.dart index b4d3104ca2..bc959d91c5 100644 --- a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_sse.dart +++ b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_sse.dart @@ -10,6 +10,10 @@ import 'package:uuid/uuid.dart'; Future handleUuidTwinSse({required UuidValue id, dynamic hint}) => RustLib.instance.api.handleUuidTwinSse(id: id, hint: hint); +Future> handleUuidsTwinSse( + {required List ids, dynamic hint}) => + RustLib.instance.api.handleUuidsTwinSse(ids: ids, hint: hint); + Future handleNestedUuidsTwinSse( {required FeatureUuidTwinSse ids, dynamic hint}) => RustLib.instance.api.handleNestedUuidsTwinSse(ids: ids, hint: hint); diff --git a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_sync.dart b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_sync.dart index 5b06bca108..b78d5624ac 100644 --- a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_sync.dart +++ b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_sync.dart @@ -10,6 +10,10 @@ import 'package:uuid/uuid.dart'; UuidValue handleUuidTwinSync({required UuidValue id, dynamic hint}) => RustLib.instance.api.handleUuidTwinSync(id: id, hint: hint); +List handleUuidsTwinSync( + {required List ids, dynamic hint}) => + RustLib.instance.api.handleUuidsTwinSync(ids: ids, hint: hint); + FeatureUuidTwinSync handleNestedUuidsTwinSync( {required FeatureUuidTwinSync ids, dynamic hint}) => RustLib.instance.api.handleNestedUuidsTwinSync(ids: ids, hint: hint); diff --git a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_sync_sse.dart b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_sync_sse.dart index da3bda45d3..1eec655217 100644 --- a/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_sync_sse.dart +++ b/frb_example/pure_dart/lib/src/rust/api/pseudo_manual/uuid_type_twin_sync_sse.dart @@ -10,6 +10,10 @@ import 'package:uuid/uuid.dart'; UuidValue handleUuidTwinSyncSse({required UuidValue id, dynamic hint}) => RustLib.instance.api.handleUuidTwinSyncSse(id: id, hint: hint); +List handleUuidsTwinSyncSse( + {required List ids, dynamic hint}) => + RustLib.instance.api.handleUuidsTwinSyncSse(ids: ids, hint: hint); + FeatureUuidTwinSyncSse handleNestedUuidsTwinSyncSse( {required FeatureUuidTwinSyncSse ids, dynamic hint}) => RustLib.instance.api.handleNestedUuidsTwinSyncSse(ids: ids, hint: hint); diff --git a/frb_example/pure_dart/lib/src/rust/api/uuid_type.dart b/frb_example/pure_dart/lib/src/rust/api/uuid_type.dart index c0c67c7fb8..011b716eed 100644 --- a/frb_example/pure_dart/lib/src/rust/api/uuid_type.dart +++ b/frb_example/pure_dart/lib/src/rust/api/uuid_type.dart @@ -10,6 +10,10 @@ import 'package:uuid/uuid.dart'; Future handleUuidTwinNormal({required UuidValue id, dynamic hint}) => RustLib.instance.api.handleUuidTwinNormal(id: id, hint: hint); +Future> handleUuidsTwinNormal( + {required List ids, dynamic hint}) => + RustLib.instance.api.handleUuidsTwinNormal(ids: ids, hint: hint); + Future handleNestedUuidsTwinNormal( {required FeatureUuidTwinNormal ids, dynamic hint}) => RustLib.instance.api.handleNestedUuidsTwinNormal(ids: ids, hint: hint); 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 3f2d7a8fb4..e8614f33de 100644 --- a/frb_example/pure_dart/lib/src/rust/frb_generated.dart +++ b/frb_example/pure_dart/lib/src/rust/frb_generated.dart @@ -7314,27 +7314,42 @@ abstract class RustLibApi extends BaseApi { Future handleUuidTwinRustAsync( {required UuidValue id, dynamic hint}); + Future> handleUuidsTwinRustAsync( + {required List ids, dynamic hint}); + Future handleNestedUuidsTwinRustAsyncSse( {required FeatureUuidTwinRustAsyncSse ids, dynamic hint}); Future handleUuidTwinRustAsyncSse( {required UuidValue id, dynamic hint}); + Future> handleUuidsTwinRustAsyncSse( + {required List ids, dynamic hint}); + Future handleNestedUuidsTwinSse( {required FeatureUuidTwinSse ids, dynamic hint}); Future handleUuidTwinSse({required UuidValue id, dynamic hint}); + Future> handleUuidsTwinSse( + {required List ids, dynamic hint}); + FeatureUuidTwinSync handleNestedUuidsTwinSync( {required FeatureUuidTwinSync ids, dynamic hint}); UuidValue handleUuidTwinSync({required UuidValue id, dynamic hint}); + List handleUuidsTwinSync( + {required List ids, dynamic hint}); + FeatureUuidTwinSyncSse handleNestedUuidsTwinSyncSse( {required FeatureUuidTwinSyncSse ids, dynamic hint}); UuidValue handleUuidTwinSyncSse({required UuidValue id, dynamic hint}); + List handleUuidsTwinSyncSse( + {required List ids, dynamic hint}); + Future testMoreThanJustOneRawStringStructTwinNormal({dynamic hint}); @@ -7612,6 +7627,9 @@ abstract class RustLibApi extends BaseApi { Future handleUuidTwinNormal({required UuidValue id, dynamic hint}); + Future> handleUuidsTwinNormal( + {required List ids, dynamic hint}); + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_BoxDartDebugTwinMoi; @@ -72453,6 +72471,30 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: ["id"], ); + @override + Future> handleUuidsTwinRustAsync( + {required List ids, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_list_Uuid(ids); + return wire.wire_handle_uuids_twin_rust_async(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_list_Uuid, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kHandleUuidsTwinRustAsyncConstMeta, + argValues: [ids], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kHandleUuidsTwinRustAsyncConstMeta => const TaskConstMeta( + debugName: "handle_uuids_twin_rust_async", + argNames: ["ids"], + ); + @override Future handleNestedUuidsTwinRustAsyncSse( {required FeatureUuidTwinRustAsyncSse ids, dynamic hint}) { @@ -72509,6 +72551,34 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: ["id"], ); + @override + Future> handleUuidsTwinRustAsyncSse( + {required List ids, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_Uuid(ids, serializer); + final raw_ = serializer.intoRaw(); + return wire.wire_handle_uuids_twin_rust_async_sse( + port_, raw_.ptr, raw_.rustVecLen, raw_.dataLen); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_Uuid, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kHandleUuidsTwinRustAsyncSseConstMeta, + argValues: [ids], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kHandleUuidsTwinRustAsyncSseConstMeta => + const TaskConstMeta( + debugName: "handle_uuids_twin_rust_async_sse", + argNames: ["ids"], + ); + @override Future handleNestedUuidsTwinSse( {required FeatureUuidTwinSse ids, dynamic hint}) { @@ -72562,6 +72632,33 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: ["id"], ); + @override + Future> handleUuidsTwinSse( + {required List ids, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_Uuid(ids, serializer); + final raw_ = serializer.intoRaw(); + return wire.wire_handle_uuids_twin_sse( + port_, raw_.ptr, raw_.rustVecLen, raw_.dataLen); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_Uuid, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kHandleUuidsTwinSseConstMeta, + argValues: [ids], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kHandleUuidsTwinSseConstMeta => const TaskConstMeta( + debugName: "handle_uuids_twin_sse", + argNames: ["ids"], + ); + @override FeatureUuidTwinSync handleNestedUuidsTwinSync( {required FeatureUuidTwinSync ids, dynamic hint}) { @@ -72609,6 +72706,30 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: ["id"], ); + @override + List handleUuidsTwinSync( + {required List ids, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_list_Uuid(ids); + return wire.wire_handle_uuids_twin_sync(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_list_Uuid, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kHandleUuidsTwinSyncConstMeta, + argValues: [ids], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kHandleUuidsTwinSyncConstMeta => const TaskConstMeta( + debugName: "handle_uuids_twin_sync", + argNames: ["ids"], + ); + @override FeatureUuidTwinSyncSse handleNestedUuidsTwinSyncSse( {required FeatureUuidTwinSyncSse ids, dynamic hint}) { @@ -72663,6 +72784,33 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: ["id"], ); + @override + List handleUuidsTwinSyncSse( + {required List ids, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_Uuid(ids, serializer); + final raw_ = serializer.intoRaw(); + return wire.wire_handle_uuids_twin_sync_sse( + raw_.ptr, raw_.rustVecLen, raw_.dataLen); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_Uuid, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kHandleUuidsTwinSyncSseConstMeta, + argValues: [ids], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kHandleUuidsTwinSyncSseConstMeta => const TaskConstMeta( + debugName: "handle_uuids_twin_sync_sse", + argNames: ["ids"], + ); + @override Future testMoreThanJustOneRawStringStructTwinNormal({dynamic hint}) { @@ -75010,6 +75158,30 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: ["id"], ); + @override + Future> handleUuidsTwinNormal( + {required List ids, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_list_Uuid(ids); + return wire.wire_handle_uuids_twin_normal(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_list_Uuid, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kHandleUuidsTwinNormalConstMeta, + argValues: [ids], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kHandleUuidsTwinNormalConstMeta => const TaskConstMeta( + debugName: "handle_uuids_twin_normal", + argNames: ["ids"], + ); + Future Function(int, dynamic) encode_DartFn_Inputs_DartOpaque_Output_unit( FutureOr Function(Object) raw) { @@ -87715,6 +87887,19 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return (raw as List).map(dco_decode_String).toList(); } + @protected + List dco_decode_list_Uuid(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + const kUuidSizeInBytes = 16; + final bytes = dco_decode_list_prim_u_8_strict(raw); + return List.generate( + bytes.lengthInBytes ~/ kUuidSizeInBytes, + (i) => UuidValue.fromByteList( + Uint8List.view(bytes.buffer, i * kUuidSizeInBytes, kUuidSizeInBytes)), + growable: false, + ); + } + @protected List dco_decode_list_application_env_var(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -105939,6 +106124,18 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return ans_; } + @protected + List sse_decode_list_Uuid(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var len_ = sse_decode_i_32(deserializer); + var ans_ = []; + for (var idx_ = 0; idx_ < len_; ++idx_) { + ans_.add(sse_decode_Uuid(deserializer)); + } + return ans_; + } + @protected List sse_decode_list_application_env_var( SseDeserializer deserializer) { @@ -125078,6 +125275,15 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } } + @protected + void sse_encode_list_Uuid(List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_Uuid(item, serializer); + } + } + @protected void sse_encode_list_application_env_var( List self, SseSerializer 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 ca6ac03149..b4a821ed4e 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 @@ -5680,6 +5680,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected List dco_decode_list_String(dynamic raw); + @protected + List dco_decode_list_Uuid(dynamic raw); + @protected List dco_decode_list_application_env_var(dynamic raw); @@ -13181,6 +13184,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected List sse_decode_list_String(SseDeserializer deserializer); + @protected + List sse_decode_list_Uuid(SseDeserializer deserializer); + @protected List sse_decode_list_application_env_var( SseDeserializer deserializer); @@ -18902,6 +18908,16 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { return ans; } + @protected + ffi.Pointer cst_encode_list_Uuid(List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_Uuid(raw.length); + for (var i = 0; i < raw.length; ++i) { + ans.ref.ptr[i] = cst_encode_Uuid(raw[i]); + } + return ans; + } + @protected ffi.Pointer cst_encode_list_application_env_var(List raw) { @@ -31616,6 +31632,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_list_String(List self, SseSerializer serializer); + @protected + void sse_encode_list_Uuid(List self, SseSerializer serializer); + @protected void sse_encode_list_application_env_var( List self, SseSerializer serializer); @@ -80936,6 +80955,24 @@ class RustLibWire implements BaseWire { _wire_handle_uuid_twin_rust_asyncPtr.asFunction< void Function(int, ffi.Pointer)>(); + void wire_handle_uuids_twin_rust_async( + int port_, + ffi.Pointer ids, + ) { + return _wire_handle_uuids_twin_rust_async( + port_, + ids, + ); + } + + late final _wire_handle_uuids_twin_rust_asyncPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_frb_example_pure_dart_wire_handle_uuids_twin_rust_async'); + late final _wire_handle_uuids_twin_rust_async = + _wire_handle_uuids_twin_rust_asyncPtr + .asFunction)>(); + void wire_handle_nested_uuids_twin_rust_async_sse( int port_, ffi.Pointer ptr_, @@ -80982,6 +81019,29 @@ class RustLibWire implements BaseWire { _wire_handle_uuid_twin_rust_async_ssePtr .asFunction, int, int)>(); + void wire_handle_uuids_twin_rust_async_sse( + int port_, + ffi.Pointer ptr_, + int rust_vec_len_, + int data_len_, + ) { + return _wire_handle_uuids_twin_rust_async_sse( + port_, + ptr_, + rust_vec_len_, + data_len_, + ); + } + + late final _wire_handle_uuids_twin_rust_async_ssePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer, ffi.Int32, ffi.Int32)>>( + 'frbgen_frb_example_pure_dart_wire_handle_uuids_twin_rust_async_sse'); + late final _wire_handle_uuids_twin_rust_async_sse = + _wire_handle_uuids_twin_rust_async_ssePtr + .asFunction, int, int)>(); + void wire_handle_nested_uuids_twin_sse( int port_, ffi.Pointer ptr_, @@ -81027,6 +81087,28 @@ class RustLibWire implements BaseWire { late final _wire_handle_uuid_twin_sse = _wire_handle_uuid_twin_ssePtr .asFunction, int, int)>(); + void wire_handle_uuids_twin_sse( + int port_, + ffi.Pointer ptr_, + int rust_vec_len_, + int data_len_, + ) { + return _wire_handle_uuids_twin_sse( + port_, + ptr_, + rust_vec_len_, + data_len_, + ); + } + + late final _wire_handle_uuids_twin_ssePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, ffi.Pointer, ffi.Int32, ffi.Int32)>>( + 'frbgen_frb_example_pure_dart_wire_handle_uuids_twin_sse'); + late final _wire_handle_uuids_twin_sse = _wire_handle_uuids_twin_ssePtr + .asFunction, int, int)>(); + WireSyncRust2DartDco wire_handle_nested_uuids_twin_sync( ffi.Pointer ids, ) { @@ -81063,6 +81145,22 @@ class RustLibWire implements BaseWire { WireSyncRust2DartDco Function( ffi.Pointer)>(); + WireSyncRust2DartDco wire_handle_uuids_twin_sync( + ffi.Pointer ids, + ) { + return _wire_handle_uuids_twin_sync( + ids, + ); + } + + late final _wire_handle_uuids_twin_syncPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.Pointer)>>( + 'frbgen_frb_example_pure_dart_wire_handle_uuids_twin_sync'); + late final _wire_handle_uuids_twin_sync = + _wire_handle_uuids_twin_syncPtr.asFunction< + WireSyncRust2DartDco Function(ffi.Pointer)>(); + WireSyncRust2DartSse wire_handle_nested_uuids_twin_sync_sse( ffi.Pointer ptr_, int rust_vec_len_, @@ -81105,6 +81203,27 @@ class RustLibWire implements BaseWire { _wire_handle_uuid_twin_sync_ssePtr.asFunction< WireSyncRust2DartSse Function(ffi.Pointer, int, int)>(); + WireSyncRust2DartSse wire_handle_uuids_twin_sync_sse( + ffi.Pointer ptr_, + int rust_vec_len_, + int data_len_, + ) { + return _wire_handle_uuids_twin_sync_sse( + ptr_, + rust_vec_len_, + data_len_, + ); + } + + late final _wire_handle_uuids_twin_sync_ssePtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartSse Function( + ffi.Pointer, ffi.Int32, ffi.Int32)>>( + 'frbgen_frb_example_pure_dart_wire_handle_uuids_twin_sync_sse'); + late final _wire_handle_uuids_twin_sync_sse = + _wire_handle_uuids_twin_sync_ssePtr.asFunction< + WireSyncRust2DartSse Function(ffi.Pointer, int, int)>(); + void wire_test_more_than_just_one_raw_string_struct_twin_normal( int port_, ) { @@ -82644,6 +82763,23 @@ class RustLibWire implements BaseWire { _wire_handle_uuid_twin_normalPtr.asFunction< void Function(int, ffi.Pointer)>(); + void wire_handle_uuids_twin_normal( + int port_, + ffi.Pointer ids, + ) { + return _wire_handle_uuids_twin_normal( + port_, + ids, + ); + } + + late final _wire_handle_uuids_twin_normalPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.Pointer)>>( + 'frbgen_frb_example_pure_dart_wire_handle_uuids_twin_normal'); + late final _wire_handle_uuids_twin_normal = _wire_handle_uuids_twin_normalPtr + .asFunction)>(); + void rust_arc_increment_strong_count_RustOpaque_BoxdynDartDebugTwinMoi( ffi.Pointer ptr, ) { @@ -91555,6 +91691,21 @@ class RustLibWire implements BaseWire { late final _cst_new_list_String = _cst_new_list_StringPtr .asFunction Function(int)>(); + ffi.Pointer cst_new_list_Uuid( + int len, + ) { + return _cst_new_list_Uuid( + len, + ); + } + + late final _cst_new_list_UuidPtr = _lookup< + ffi + .NativeFunction Function(ffi.Int32)>>( + 'frbgen_frb_example_pure_dart_cst_new_list_Uuid'); + late final _cst_new_list_Uuid = _cst_new_list_UuidPtr + .asFunction Function(int)>(); + ffi.Pointer cst_new_list_application_env_var( int len, @@ -96547,6 +96698,13 @@ final class wire_cst_feature_uuid_twin_rust_async extends ffi.Struct { external ffi.Pointer one; } +final class wire_cst_list_Uuid extends ffi.Struct { + external ffi.Pointer> ptr; + + @ffi.Int32() + external int len; +} + final class wire_cst_feature_uuid_twin_sync extends ffi.Struct { external ffi.Pointer one; } 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 8e7d88c3f2..ae72ceafe7 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 @@ -5679,6 +5679,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected List dco_decode_list_String(dynamic raw); + @protected + List dco_decode_list_Uuid(dynamic raw); + @protected List dco_decode_list_application_env_var(dynamic raw); @@ -13180,6 +13183,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected List sse_decode_list_String(SseDeserializer deserializer); + @protected + List sse_decode_list_Uuid(SseDeserializer deserializer); + @protected List sse_decode_list_application_env_var( SseDeserializer deserializer); @@ -19787,6 +19793,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { return raw.map(cst_encode_String).toList(); } + @protected + List cst_encode_list_Uuid(List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw.map(cst_encode_Uuid).toList(); + } + @protected List cst_encode_list_application_env_var( List raw) { @@ -28504,6 +28516,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_list_String(List self, SseSerializer serializer); + @protected + void sse_encode_list_Uuid(List self, SseSerializer serializer); + @protected void sse_encode_list_application_env_var( List self, SseSerializer serializer); @@ -45412,6 +45427,10 @@ class RustLibWire implements BaseWire { void wire_handle_uuid_twin_rust_async(NativePortType port_, Uint8List id) => wasmModule.wire_handle_uuid_twin_rust_async(port_, id); + void wire_handle_uuids_twin_rust_async( + NativePortType port_, List ids) => + wasmModule.wire_handle_uuids_twin_rust_async(port_, ids); + void wire_handle_nested_uuids_twin_rust_async_sse( NativePortType port_, PlatformGeneralizedUint8ListPtr ptr_, @@ -45428,6 +45447,14 @@ class RustLibWire implements BaseWire { wasmModule.wire_handle_uuid_twin_rust_async_sse( port_, ptr_, rust_vec_len_, data_len_); + void wire_handle_uuids_twin_rust_async_sse( + NativePortType port_, + PlatformGeneralizedUint8ListPtr ptr_, + int rust_vec_len_, + int data_len_) => + wasmModule.wire_handle_uuids_twin_rust_async_sse( + port_, ptr_, rust_vec_len_, data_len_); + void wire_handle_nested_uuids_twin_sse( NativePortType port_, PlatformGeneralizedUint8ListPtr ptr_, @@ -45444,6 +45471,14 @@ class RustLibWire implements BaseWire { wasmModule.wire_handle_uuid_twin_sse( port_, ptr_, rust_vec_len_, data_len_); + void wire_handle_uuids_twin_sse( + NativePortType port_, + PlatformGeneralizedUint8ListPtr ptr_, + int rust_vec_len_, + int data_len_) => + wasmModule.wire_handle_uuids_twin_sse( + port_, ptr_, rust_vec_len_, data_len_); + dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartDco */ wire_handle_nested_uuids_twin_sync(List ids) => wasmModule.wire_handle_nested_uuids_twin_sync(ids); @@ -45452,6 +45487,10 @@ class RustLibWire implements BaseWire { wire_handle_uuid_twin_sync(Uint8List id) => wasmModule.wire_handle_uuid_twin_sync(id); + dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartDco */ + wire_handle_uuids_twin_sync(List ids) => + wasmModule.wire_handle_uuids_twin_sync(ids); + dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartSse */ wire_handle_nested_uuids_twin_sync_sse( PlatformGeneralizedUint8ListPtr ptr_, @@ -45466,6 +45505,12 @@ class RustLibWire implements BaseWire { wasmModule.wire_handle_uuid_twin_sync_sse( ptr_, rust_vec_len_, data_len_); + dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartSse */ + wire_handle_uuids_twin_sync_sse(PlatformGeneralizedUint8ListPtr ptr_, + int rust_vec_len_, int data_len_) => + wasmModule.wire_handle_uuids_twin_sync_sse( + ptr_, rust_vec_len_, data_len_); + void wire_test_more_than_just_one_raw_string_struct_twin_normal( NativePortType port_) => wasmModule @@ -45843,6 +45888,9 @@ class RustLibWire implements BaseWire { void wire_handle_uuid_twin_normal(NativePortType port_, Uint8List id) => wasmModule.wire_handle_uuid_twin_normal(port_, id); + void wire_handle_uuids_twin_normal(NativePortType port_, List ids) => + wasmModule.wire_handle_uuids_twin_normal(port_, ids); + void rust_arc_increment_strong_count_RustOpaque_BoxdynDartDebugTwinMoi( dynamic ptr) => wasmModule @@ -57391,6 +57439,9 @@ class RustLibWasmModule implements WasmModule { external void wire_handle_uuid_twin_rust_async( NativePortType port_, Uint8List id); + external void wire_handle_uuids_twin_rust_async( + NativePortType port_, List ids); + external void wire_handle_nested_uuids_twin_rust_async_sse( NativePortType port_, PlatformGeneralizedUint8ListPtr ptr_, @@ -57400,18 +57451,27 @@ class RustLibWasmModule implements WasmModule { external void wire_handle_uuid_twin_rust_async_sse(NativePortType port_, PlatformGeneralizedUint8ListPtr ptr_, int rust_vec_len_, int data_len_); + external void wire_handle_uuids_twin_rust_async_sse(NativePortType port_, + PlatformGeneralizedUint8ListPtr ptr_, int rust_vec_len_, int data_len_); + external void wire_handle_nested_uuids_twin_sse(NativePortType port_, PlatformGeneralizedUint8ListPtr ptr_, int rust_vec_len_, int data_len_); external void wire_handle_uuid_twin_sse(NativePortType port_, PlatformGeneralizedUint8ListPtr ptr_, int rust_vec_len_, int data_len_); + external void wire_handle_uuids_twin_sse(NativePortType port_, + PlatformGeneralizedUint8ListPtr ptr_, int rust_vec_len_, int data_len_); + external dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartDco */ wire_handle_nested_uuids_twin_sync(List ids); external dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartDco */ wire_handle_uuid_twin_sync(Uint8List id); + external dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartDco */ + wire_handle_uuids_twin_sync(List ids); + external dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartSse */ wire_handle_nested_uuids_twin_sync_sse( PlatformGeneralizedUint8ListPtr ptr_, @@ -57422,6 +57482,10 @@ class RustLibWasmModule implements WasmModule { wire_handle_uuid_twin_sync_sse(PlatformGeneralizedUint8ListPtr ptr_, int rust_vec_len_, int data_len_); + external dynamic /* flutter_rust_bridge::for_generated::WireSyncRust2DartSse */ + wire_handle_uuids_twin_sync_sse(PlatformGeneralizedUint8ListPtr ptr_, + int rust_vec_len_, int data_len_); + external void wire_test_more_than_just_one_raw_string_struct_twin_normal( NativePortType port_); @@ -57687,6 +57751,9 @@ class RustLibWasmModule implements WasmModule { external void wire_handle_uuid_twin_normal( NativePortType port_, Uint8List id); + external void wire_handle_uuids_twin_normal( + NativePortType port_, List ids); + external void rust_arc_increment_strong_count_RustOpaque_BoxdynDartDebugTwinMoi( dynamic ptr); diff --git a/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_rust_async.rs b/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_rust_async.rs index 0f7ad663e5..9a53f0b946 100644 --- a/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_rust_async.rs +++ b/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_rust_async.rs @@ -12,10 +12,9 @@ pub async fn handle_uuid_twin_rust_async(id: uuid::Uuid) -> anyhow::Result` is supported using SSE (serializer) -// pub async fn handle_uuids_twin_rust_async(ids: Vec) -> anyhow::Result> { -// Ok(ids) -// } +pub async fn handle_uuids_twin_rust_async(ids: Vec) -> anyhow::Result> { + Ok(ids) +} pub async fn handle_nested_uuids_twin_rust_async( ids: FeatureUuidTwinRustAsync, diff --git a/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_rust_async_sse.rs b/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_rust_async_sse.rs index a77003ff34..258f1f276b 100644 --- a/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_rust_async_sse.rs +++ b/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_rust_async_sse.rs @@ -13,10 +13,12 @@ pub async fn handle_uuid_twin_rust_async_sse(id: uuid::Uuid) -> anyhow::Result` is supported using SSE (serializer) -// #[flutter_rust_bridge::frb(serialize)] pub async fn handle_uuids_twin_rust_async_sse(ids: Vec) -> anyhow::Result> { -// Ok(ids) -// } +#[flutter_rust_bridge::frb(serialize)] +pub async fn handle_uuids_twin_rust_async_sse( + ids: Vec, +) -> anyhow::Result> { + Ok(ids) +} #[flutter_rust_bridge::frb(serialize)] pub async fn handle_nested_uuids_twin_rust_async_sse( diff --git a/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_sse.rs b/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_sse.rs index 8885226195..75bafa4140 100644 --- a/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_sse.rs +++ b/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_sse.rs @@ -13,10 +13,10 @@ pub fn handle_uuid_twin_sse(id: uuid::Uuid) -> anyhow::Result { Ok(id) } -// TODO: For simplicity, `Vec` is supported using SSE (serializer) -// #[flutter_rust_bridge::frb(serialize)] pub fn handle_uuids_twin_sse(ids: Vec) -> anyhow::Result> { -// Ok(ids) -// } +#[flutter_rust_bridge::frb(serialize)] +pub fn handle_uuids_twin_sse(ids: Vec) -> anyhow::Result> { + Ok(ids) +} #[flutter_rust_bridge::frb(serialize)] pub fn handle_nested_uuids_twin_sse(ids: FeatureUuidTwinSse) -> anyhow::Result { diff --git a/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_sync.rs b/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_sync.rs index 88f771335b..f686b26ee0 100644 --- a/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_sync.rs +++ b/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_sync.rs @@ -13,10 +13,10 @@ pub fn handle_uuid_twin_sync(id: uuid::Uuid) -> anyhow::Result { Ok(id) } -// TODO: For simplicity, `Vec` is supported using SSE (serializer) -// #[flutter_rust_bridge::frb(sync)] pub fn handle_uuids_twin_sync(ids: Vec) -> anyhow::Result> { -// Ok(ids) -// } +#[flutter_rust_bridge::frb(sync)] +pub fn handle_uuids_twin_sync(ids: Vec) -> anyhow::Result> { + Ok(ids) +} #[flutter_rust_bridge::frb(sync)] pub fn handle_nested_uuids_twin_sync( diff --git a/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_sync_sse.rs b/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_sync_sse.rs index 8d9f2af8a3..4243eca389 100644 --- a/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_sync_sse.rs +++ b/frb_example/pure_dart/rust/src/api/pseudo_manual/uuid_type_twin_sync_sse.rs @@ -14,10 +14,11 @@ pub fn handle_uuid_twin_sync_sse(id: uuid::Uuid) -> anyhow::Result { Ok(id) } -// TODO: For simplicity, `Vec` is supported using SSE (serializer) -// #[flutter_rust_bridge::frb(serialize)] #[flutter_rust_bridge::frb(sync)] pub fn handle_uuids_twin_sync_sse(ids: Vec) -> anyhow::Result> { -// Ok(ids) -// } +#[flutter_rust_bridge::frb(serialize)] +#[flutter_rust_bridge::frb(sync)] +pub fn handle_uuids_twin_sync_sse(ids: Vec) -> anyhow::Result> { + Ok(ids) +} #[flutter_rust_bridge::frb(serialize)] #[flutter_rust_bridge::frb(sync)] diff --git a/frb_example/pure_dart/rust/src/api/uuid_type.rs b/frb_example/pure_dart/rust/src/api/uuid_type.rs index 0d11907e61..55c84bfa6c 100644 --- a/frb_example/pure_dart/rust/src/api/uuid_type.rs +++ b/frb_example/pure_dart/rust/src/api/uuid_type.rs @@ -8,10 +8,9 @@ pub fn handle_uuid_twin_normal(id: uuid::Uuid) -> anyhow::Result { Ok(id) } -// TODO: For simplicity, `Vec` is supported using SSE (serializer) -// pub fn handle_uuids_twin_normal(ids: Vec) -> anyhow::Result> { -// Ok(ids) -// } +pub fn handle_uuids_twin_normal(ids: Vec) -> anyhow::Result> { + Ok(ids) +} pub fn handle_nested_uuids_twin_normal( ids: FeatureUuidTwinNormal, 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 be868928b9..ef3bff7850 100644 --- a/frb_example/pure_dart/rust/src/frb_generated.io.rs +++ b/frb_example/pure_dart/rust/src/frb_generated.io.rs @@ -7026,6 +7026,16 @@ impl CstDecode> for *mut wire_cst_list_String { vec.into_iter().map(CstDecode::cst_decode).collect() } } +impl CstDecode> for *mut wire_cst_list_Uuid { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + let vec = unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + }; + vec.into_iter().map(CstDecode::cst_decode).collect() + } +} impl CstDecode> for *mut wire_cst_list_application_env_var { @@ -35656,6 +35666,14 @@ pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_uuid_twin_rust_async( wire_handle_uuid_twin_rust_async_impl(port_, id) } +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_uuids_twin_rust_async( + port_: i64, + ids: *mut wire_cst_list_Uuid, +) { + wire_handle_uuids_twin_rust_async_impl(port_, ids) +} + #[no_mangle] pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_nested_uuids_twin_rust_async_sse( port_: i64, @@ -35676,6 +35694,16 @@ pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_uuid_twin_rust_async_ wire_handle_uuid_twin_rust_async_sse_impl(port_, ptr_, rust_vec_len_, data_len_) } +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_uuids_twin_rust_async_sse( + port_: i64, + ptr_: *mut u8, + rust_vec_len_: i32, + data_len_: i32, +) { + wire_handle_uuids_twin_rust_async_sse_impl(port_, ptr_, rust_vec_len_, data_len_) +} + #[no_mangle] pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_nested_uuids_twin_sse( port_: i64, @@ -35696,6 +35724,16 @@ pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_uuid_twin_sse( wire_handle_uuid_twin_sse_impl(port_, ptr_, rust_vec_len_, data_len_) } +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_uuids_twin_sse( + port_: i64, + ptr_: *mut u8, + rust_vec_len_: i32, + data_len_: i32, +) { + wire_handle_uuids_twin_sse_impl(port_, ptr_, rust_vec_len_, data_len_) +} + #[no_mangle] pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_nested_uuids_twin_sync( ids: *mut wire_cst_feature_uuid_twin_sync, @@ -35710,6 +35748,13 @@ pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_uuid_twin_sync( wire_handle_uuid_twin_sync_impl(id) } +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_uuids_twin_sync( + ids: *mut wire_cst_list_Uuid, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_handle_uuids_twin_sync_impl(ids) +} + #[no_mangle] pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_nested_uuids_twin_sync_sse( ptr_: *mut u8, @@ -35728,6 +35773,15 @@ pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_uuid_twin_sync_sse( wire_handle_uuid_twin_sync_sse_impl(ptr_, rust_vec_len_, data_len_) } +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_uuids_twin_sync_sse( + ptr_: *mut u8, + rust_vec_len_: i32, + data_len_: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + wire_handle_uuids_twin_sync_sse_impl(ptr_, rust_vec_len_, data_len_) +} + #[no_mangle] pub extern "C" fn frbgen_frb_example_pure_dart_wire_test_more_than_just_one_raw_string_struct_twin_normal( port_: i64, @@ -36397,6 +36451,14 @@ pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_uuid_twin_normal( wire_handle_uuid_twin_normal_impl(port_, id) } +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_wire_handle_uuids_twin_normal( + port_: i64, + ids: *mut wire_cst_list_Uuid, +) { + wire_handle_uuids_twin_normal_impl(port_, ids) +} + #[no_mangle] pub extern "C" fn frbgen_frb_example_pure_dart_rust_arc_increment_strong_count_RustOpaque_BoxdynDartDebugTwinMoi( ptr: *const std::ffi::c_void, @@ -41296,6 +41358,20 @@ pub extern "C" fn frbgen_frb_example_pure_dart_cst_new_list_String( flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) } +#[no_mangle] +pub extern "C" fn frbgen_frb_example_pure_dart_cst_new_list_Uuid( + len: i32, +) -> *mut wire_cst_list_Uuid { + let wrap = wire_cst_list_Uuid { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr( + <*mut wire_cst_list_prim_u_8_strict>::new_with_null_ptr(), + len, + ), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) +} + #[no_mangle] pub extern "C" fn frbgen_frb_example_pure_dart_cst_new_list_application_env_var( len: i32, @@ -44772,6 +44848,12 @@ pub struct wire_cst_list_String { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_list_Uuid { + ptr: *mut *mut wire_cst_list_prim_u_8_strict, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_list_application_env_var { ptr: *mut wire_cst_application_env_var, len: i32, diff --git a/frb_example/pure_dart/rust/src/frb_generated.rs b/frb_example/pure_dart/rust/src/frb_generated.rs index ff9868e8ae..c282146ddc 100644 --- a/frb_example/pure_dart/rust/src/frb_generated.rs +++ b/frb_example/pure_dart/rust/src/frb_generated.rs @@ -34331,6 +34331,16 @@ fn wire_handle_uuid_twin_rust_async_impl( })().await) } }) } +fn wire_handle_uuids_twin_rust_async_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ids: impl CstDecode>, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "handle_uuids_twin_rust_async", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || { let api_ids = ids.cst_decode(); move |context| async move { + transform_result_dco((move || async move { + crate::api::pseudo_manual::uuid_type_twin_rust_async::handle_uuids_twin_rust_async(api_ids).await + })().await) + } }) +} fn wire_handle_nested_uuids_twin_rust_async_sse_impl( port_: flutter_rust_bridge::for_generated::MessagePort, ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, @@ -34361,6 +34371,21 @@ fn wire_handle_uuid_twin_rust_async_sse_impl( })().await) } }) } +fn wire_handle_uuids_twin_rust_async_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_async::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "handle_uuids_twin_rust_async_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); + let api_ids = >::sse_decode(&mut deserializer);deserializer.end(); move |context| async move { + transform_result_sse((move || async move { + crate::api::pseudo_manual::uuid_type_twin_rust_async_sse::handle_uuids_twin_rust_async_sse(api_ids).await + })().await) + } }) +} fn wire_handle_nested_uuids_twin_sse_impl( port_: flutter_rust_bridge::for_generated::MessagePort, ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, @@ -34430,6 +34455,38 @@ fn wire_handle_uuid_twin_sse_impl( }, ) } +fn wire_handle_uuids_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: "handle_uuids_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); + let api_ids = >::sse_decode(&mut deserializer); + deserializer.end(); + move |context| { + transform_result_sse((move || { + crate::api::pseudo_manual::uuid_type_twin_sse::handle_uuids_twin_sse(api_ids) + })()) + } + }, + ) +} fn wire_handle_nested_uuids_twin_sync_impl( ids: impl CstDecode, ) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { @@ -34466,6 +34523,23 @@ fn wire_handle_uuid_twin_sync_impl( }, ) } +fn wire_handle_uuids_twin_sync_impl( + ids: impl CstDecode>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "handle_uuids_twin_sync", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_ids = ids.cst_decode(); + transform_result_dco((move || { + crate::api::pseudo_manual::uuid_type_twin_sync::handle_uuids_twin_sync(api_ids) + })()) + }, + ) +} fn wire_handle_nested_uuids_twin_sync_sse_impl( ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, rust_vec_len_: i32, @@ -34510,6 +34584,37 @@ fn wire_handle_uuid_twin_sync_sse_impl( }, ) } +fn wire_handle_uuids_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: "handle_uuids_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); + let api_ids = >::sse_decode(&mut deserializer); + deserializer.end(); + transform_result_sse((move || { + crate::api::pseudo_manual::uuid_type_twin_sync_sse::handle_uuids_twin_sync_sse( + api_ids, + ) + })()) + }, + ) +} fn wire_test_more_than_just_one_raw_string_struct_twin_normal_impl( port_: flutter_rust_bridge::for_generated::MessagePort, ) { @@ -36149,6 +36254,26 @@ fn wire_handle_uuid_twin_normal_impl( }, ) } +fn wire_handle_uuids_twin_normal_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ids: impl CstDecode>, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "handle_uuids_twin_normal", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_ids = ids.cst_decode(); + move |context| { + transform_result_dco((move || { + crate::api::uuid_type::handle_uuids_twin_normal(api_ids) + })()) + } + }, + ) +} // Section: wrapper_structs @@ -46274,6 +46399,18 @@ impl SseDecode for Vec { } } +impl SseDecode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(::sse_decode(deserializer)); + } + return ans_; + } +} + impl SseDecode for Vec { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -76424,6 +76561,16 @@ impl SseEncode for Vec { } } +impl SseEncode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } + } +} + impl SseEncode for Vec { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { 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 7e395cfdb8..7f677d024b 100644 --- a/frb_example/pure_dart/rust/src/frb_generated.web.rs +++ b/frb_example/pure_dart/rust/src/frb_generated.web.rs @@ -2943,6 +2943,16 @@ impl CstDecode> for flutter_rust_bridge::for_generated::wasm_bindgen .collect() } } +impl CstDecode> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + self.dyn_into::() + .unwrap() + .iter() + .map(CstDecode::cst_decode) + .collect() + } +} impl CstDecode> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { @@ -32294,6 +32304,14 @@ pub fn wire_handle_uuid_twin_rust_async( wire_handle_uuid_twin_rust_async_impl(port_, id) } +#[wasm_bindgen] +pub fn wire_handle_uuids_twin_rust_async( + port_: flutter_rust_bridge::for_generated::MessagePort, + ids: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire_handle_uuids_twin_rust_async_impl(port_, ids) +} + #[wasm_bindgen] pub fn wire_handle_nested_uuids_twin_rust_async_sse( port_: flutter_rust_bridge::for_generated::MessagePort, @@ -32314,6 +32332,16 @@ pub fn wire_handle_uuid_twin_rust_async_sse( wire_handle_uuid_twin_rust_async_sse_impl(port_, ptr_, rust_vec_len_, data_len_) } +#[wasm_bindgen] +pub fn wire_handle_uuids_twin_rust_async_sse( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) { + wire_handle_uuids_twin_rust_async_sse_impl(port_, ptr_, rust_vec_len_, data_len_) +} + #[wasm_bindgen] pub fn wire_handle_nested_uuids_twin_sse( port_: flutter_rust_bridge::for_generated::MessagePort, @@ -32334,6 +32362,16 @@ pub fn wire_handle_uuid_twin_sse( wire_handle_uuid_twin_sse_impl(port_, ptr_, rust_vec_len_, data_len_) } +#[wasm_bindgen] +pub fn wire_handle_uuids_twin_sse( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) { + wire_handle_uuids_twin_sse_impl(port_, ptr_, rust_vec_len_, data_len_) +} + #[wasm_bindgen] pub fn wire_handle_nested_uuids_twin_sync( ids: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, @@ -32348,6 +32386,13 @@ pub fn wire_handle_uuid_twin_sync( wire_handle_uuid_twin_sync_impl(id) } +#[wasm_bindgen] +pub fn wire_handle_uuids_twin_sync( + ids: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_handle_uuids_twin_sync_impl(ids) +} + #[wasm_bindgen] pub fn wire_handle_nested_uuids_twin_sync_sse( ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, @@ -32366,6 +32411,15 @@ pub fn wire_handle_uuid_twin_sync_sse( wire_handle_uuid_twin_sync_sse_impl(ptr_, rust_vec_len_, data_len_) } +#[wasm_bindgen] +pub fn wire_handle_uuids_twin_sync_sse( + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + wire_handle_uuids_twin_sync_sse_impl(ptr_, rust_vec_len_, data_len_) +} + #[wasm_bindgen] pub fn wire_test_more_than_just_one_raw_string_struct_twin_normal( port_: flutter_rust_bridge::for_generated::MessagePort, @@ -33037,6 +33091,14 @@ pub fn wire_handle_uuid_twin_normal( wire_handle_uuid_twin_normal_impl(port_, id) } +#[wasm_bindgen] +pub fn wire_handle_uuids_twin_normal( + port_: flutter_rust_bridge::for_generated::MessagePort, + ids: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, +) { + wire_handle_uuids_twin_normal_impl(port_, ids) +} + #[wasm_bindgen] pub fn rust_arc_increment_strong_count_RustOpaque_BoxdynDartDebugTwinMoi( ptr: *const std::ffi::c_void, diff --git a/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_rust_async_sse_test.dart b/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_rust_async_sse_test.dart index 56723adb30..bc8c213bff 100644 --- a/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_rust_async_sse_test.dart +++ b/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_rust_async_sse_test.dart @@ -17,14 +17,13 @@ Future main({bool skipRustLibInit = false}) async { expect(id, output); }); - // TODO: For simplicity, `Vec` is supported using SSE (serializer) - // test('Vec', () async { - // final uuid = Uuid(); - // final ids = - // List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); - // final outputs = await handleUuidsTwinRustAsyncSse(ids: ids); - // expect(ids, outputs); - // }); + test('Vec', () async { + final uuid = Uuid(); + final ids = + List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); + final outputs = await handleUuidsTwinRustAsyncSse(ids: ids); + expect(ids, outputs); + }); test('nested uuid types', () async { final uuid = Uuid(); diff --git a/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_rust_async_test.dart b/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_rust_async_test.dart index 500813486d..ef4f8a740e 100644 --- a/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_rust_async_test.dart +++ b/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_rust_async_test.dart @@ -17,14 +17,13 @@ Future main({bool skipRustLibInit = false}) async { expect(id, output); }); - // TODO: For simplicity, `Vec` is supported using SSE (serializer) - // test('Vec', () async { - // final uuid = Uuid(); - // final ids = - // List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); - // final outputs = await handleUuidsTwinRustAsync(ids: ids); - // expect(ids, outputs); - // }); + test('Vec', () async { + final uuid = Uuid(); + final ids = + List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); + final outputs = await handleUuidsTwinRustAsync(ids: ids); + expect(ids, outputs); + }); test('nested uuid types', () async { final uuid = Uuid(); diff --git a/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_sse_test.dart b/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_sse_test.dart index 8abd1ebc66..645d4a67fe 100644 --- a/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_sse_test.dart +++ b/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_sse_test.dart @@ -17,14 +17,13 @@ Future main({bool skipRustLibInit = false}) async { expect(id, output); }); - // TODO: For simplicity, `Vec` is supported using SSE (serializer) - // test('Vec', () async { - // final uuid = Uuid(); - // final ids = - // List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); - // final outputs = await handleUuidsTwinSse(ids: ids); - // expect(ids, outputs); - // }); + test('Vec', () async { + final uuid = Uuid(); + final ids = + List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); + final outputs = await handleUuidsTwinSse(ids: ids); + expect(ids, outputs); + }); test('nested uuid types', () async { final uuid = Uuid(); diff --git a/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_sync_sse_test.dart b/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_sync_sse_test.dart index 8b4622c5f7..668e4012c8 100644 --- a/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_sync_sse_test.dart +++ b/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_sync_sse_test.dart @@ -17,14 +17,13 @@ Future main({bool skipRustLibInit = false}) async { expect(id, output); }); - // TODO: For simplicity, `Vec` is supported using SSE (serializer) - // test('Vec', () async { - // final uuid = Uuid(); - // final ids = - // List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); - // final outputs = await handleUuidsTwinSyncSse(ids: ids); - // expect(ids, outputs); - // }); + test('Vec', () async { + final uuid = Uuid(); + final ids = + List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); + final outputs = await handleUuidsTwinSyncSse(ids: ids); + expect(ids, outputs); + }); test('nested uuid types', () async { final uuid = Uuid(); diff --git a/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_sync_test.dart b/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_sync_test.dart index 09ae8d9690..24a05697ef 100644 --- a/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_sync_test.dart +++ b/frb_example/pure_dart/test/api/pseudo_manual/uuid_type_twin_sync_test.dart @@ -17,14 +17,13 @@ Future main({bool skipRustLibInit = false}) async { expect(id, output); }); - // TODO: For simplicity, `Vec` is supported using SSE (serializer) - // test('Vec', () async { - // final uuid = Uuid(); - // final ids = - // List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); - // final outputs = await handleUuidsTwinSync(ids: ids); - // expect(ids, outputs); - // }); + test('Vec', () async { + final uuid = Uuid(); + final ids = + List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); + final outputs = await handleUuidsTwinSync(ids: ids); + expect(ids, outputs); + }); test('nested uuid types', () async { final uuid = Uuid(); diff --git a/frb_example/pure_dart/test/api/uuid_type_test.dart b/frb_example/pure_dart/test/api/uuid_type_test.dart index 113e635d77..8eab7e8efe 100644 --- a/frb_example/pure_dart/test/api/uuid_type_test.dart +++ b/frb_example/pure_dart/test/api/uuid_type_test.dart @@ -13,14 +13,13 @@ Future main({bool skipRustLibInit = false}) async { expect(id, output); }); - // TODO: For simplicity, `Vec` is supported using SSE (serializer) - // test('Vec', () async { - // final uuid = Uuid(); - // final ids = - // List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); - // final outputs = await handleUuidsTwinNormal(ids: ids); - // expect(ids, outputs); - // }); + test('Vec', () async { + final uuid = Uuid(); + final ids = + List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); + final outputs = await handleUuidsTwinNormal(ids: ids); + expect(ids, outputs); + }); test('nested uuid types', () async { final uuid = Uuid(); diff --git a/frb_example/pure_dart_pde/lib/src/rust/api/pseudo_manual/uuid_type_twin_rust_async.dart b/frb_example/pure_dart_pde/lib/src/rust/api/pseudo_manual/uuid_type_twin_rust_async.dart index 445f971884..374381c56a 100644 --- a/frb_example/pure_dart_pde/lib/src/rust/api/pseudo_manual/uuid_type_twin_rust_async.dart +++ b/frb_example/pure_dart_pde/lib/src/rust/api/pseudo_manual/uuid_type_twin_rust_async.dart @@ -11,6 +11,10 @@ Future handleUuidTwinRustAsync( {required UuidValue id, dynamic hint}) => RustLib.instance.api.handleUuidTwinRustAsync(id: id, hint: hint); +Future> handleUuidsTwinRustAsync( + {required List ids, dynamic hint}) => + RustLib.instance.api.handleUuidsTwinRustAsync(ids: ids, hint: hint); + Future handleNestedUuidsTwinRustAsync( {required FeatureUuidTwinRustAsync ids, dynamic hint}) => RustLib.instance.api.handleNestedUuidsTwinRustAsync(ids: ids, hint: hint); diff --git a/frb_example/pure_dart_pde/lib/src/rust/api/pseudo_manual/uuid_type_twin_sync.dart b/frb_example/pure_dart_pde/lib/src/rust/api/pseudo_manual/uuid_type_twin_sync.dart index 5b06bca108..b78d5624ac 100644 --- a/frb_example/pure_dart_pde/lib/src/rust/api/pseudo_manual/uuid_type_twin_sync.dart +++ b/frb_example/pure_dart_pde/lib/src/rust/api/pseudo_manual/uuid_type_twin_sync.dart @@ -10,6 +10,10 @@ import 'package:uuid/uuid.dart'; UuidValue handleUuidTwinSync({required UuidValue id, dynamic hint}) => RustLib.instance.api.handleUuidTwinSync(id: id, hint: hint); +List handleUuidsTwinSync( + {required List ids, dynamic hint}) => + RustLib.instance.api.handleUuidsTwinSync(ids: ids, hint: hint); + FeatureUuidTwinSync handleNestedUuidsTwinSync( {required FeatureUuidTwinSync ids, dynamic hint}) => RustLib.instance.api.handleNestedUuidsTwinSync(ids: ids, hint: hint); diff --git a/frb_example/pure_dart_pde/lib/src/rust/api/uuid_type.dart b/frb_example/pure_dart_pde/lib/src/rust/api/uuid_type.dart index c0c67c7fb8..011b716eed 100644 --- a/frb_example/pure_dart_pde/lib/src/rust/api/uuid_type.dart +++ b/frb_example/pure_dart_pde/lib/src/rust/api/uuid_type.dart @@ -10,6 +10,10 @@ import 'package:uuid/uuid.dart'; Future handleUuidTwinNormal({required UuidValue id, dynamic hint}) => RustLib.instance.api.handleUuidTwinNormal(id: id, hint: hint); +Future> handleUuidsTwinNormal( + {required List ids, dynamic hint}) => + RustLib.instance.api.handleUuidsTwinNormal(ids: ids, hint: hint); + Future handleNestedUuidsTwinNormal( {required FeatureUuidTwinNormal ids, dynamic hint}) => RustLib.instance.api.handleNestedUuidsTwinNormal(ids: ids, hint: hint); diff --git a/frb_example/pure_dart_pde/lib/src/rust/frb_generated.dart b/frb_example/pure_dart_pde/lib/src/rust/frb_generated.dart index 713bac0a40..3423b475c6 100644 --- a/frb_example/pure_dart_pde/lib/src/rust/frb_generated.dart +++ b/frb_example/pure_dart_pde/lib/src/rust/frb_generated.dart @@ -2927,11 +2927,17 @@ abstract class RustLibApi extends BaseApi { Future handleUuidTwinRustAsync( {required UuidValue id, dynamic hint}); + Future> handleUuidsTwinRustAsync( + {required List ids, dynamic hint}); + FeatureUuidTwinSync handleNestedUuidsTwinSync( {required FeatureUuidTwinSync ids, dynamic hint}); UuidValue handleUuidTwinSync({required UuidValue id, dynamic hint}); + List handleUuidsTwinSync( + {required List ids, dynamic hint}); + Future testMoreThanJustOneRawStringStructTwinNormal({dynamic hint}); @@ -3209,6 +3215,9 @@ abstract class RustLibApi extends BaseApi { Future handleUuidTwinNormal({required UuidValue id, dynamic hint}); + Future> handleUuidsTwinNormal( + {required List ids, dynamic hint}); + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_BoxDartDebugTwinNormal; @@ -28621,7 +28630,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_box_autoadd_feature_uuid_twin_rust_async(ids, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 940, port: port_); + funcId: 941, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_feature_uuid_twin_rust_async, @@ -28666,6 +28675,32 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: ["id"], ); + @override + Future> handleUuidsTwinRustAsync( + {required List ids, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_Uuid(ids, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 940, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_Uuid, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kHandleUuidsTwinRustAsyncConstMeta, + argValues: [ids], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kHandleUuidsTwinRustAsyncConstMeta => const TaskConstMeta( + debugName: "handle_uuids_twin_rust_async", + argNames: ["ids"], + ); + @override FeatureUuidTwinSync handleNestedUuidsTwinSync( {required FeatureUuidTwinSync ids, dynamic hint}) { @@ -28673,7 +28708,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: () { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_box_autoadd_feature_uuid_twin_sync(ids, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 942)!; + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 944)!; }, codec: SseCodec( decodeSuccessData: sse_decode_feature_uuid_twin_sync, @@ -28697,7 +28732,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: () { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_Uuid(id, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 941)!; + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 942)!; }, codec: SseCodec( decodeSuccessData: sse_decode_Uuid, @@ -28715,6 +28750,31 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: ["id"], ); + @override + List handleUuidsTwinSync( + {required List ids, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_Uuid(ids, serializer); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 943)!; + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_Uuid, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kHandleUuidsTwinSyncConstMeta, + argValues: [ids], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kHandleUuidsTwinSyncConstMeta => const TaskConstMeta( + debugName: "handle_uuids_twin_sync", + argNames: ["ids"], + ); + @override Future testMoreThanJustOneRawStringStructTwinNormal({dynamic hint}) { @@ -28722,7 +28782,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 944, port: port_); + funcId: 946, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -28749,7 +28809,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 943, port: port_); + funcId: 945, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_raw_string_item_struct_twin_normal, @@ -28777,7 +28837,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNonCloneSimpleTwinNormal( that, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 986, port: port_); + funcId: 988, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -28808,7 +28868,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNonCloneSimpleTwinNormal( that, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 987, port: port_); + funcId: 989, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -28839,7 +28899,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNonCloneSimpleTwinNormal( that, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 985, port: port_); + funcId: 987, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -28870,7 +28930,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNonCloneSimpleTwinNormal( that, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 989, port: port_); + funcId: 991, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_i_32, @@ -28902,7 +28962,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNonCloneSimpleTwinNormal( that, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 988, port: port_); + funcId: 990, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -28932,7 +28992,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 983, port: port_); + funcId: 985, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -28959,7 +29019,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 982, port: port_); + funcId: 984, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -28986,7 +29046,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 984, port: port_); + funcId: 986, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -29015,7 +29075,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNonCloneSimpleTwinNormal( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 979, port: port_); + funcId: 981, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29046,7 +29106,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNonCloneSimpleTwinNormal( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 980, port: port_); + funcId: 982, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29077,7 +29137,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNonCloneSimpleTwinNormal( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 978, port: port_); + funcId: 980, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29105,7 +29165,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 981, port: port_); + funcId: 983, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -29140,7 +29200,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { arg, serializer); sse_encode_i_32(expect, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 946, port: port_); + funcId: 948, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29173,7 +29233,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_i_32(expect, serializer); sse_encode_i_32(adder, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 947, port: port_); + funcId: 949, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29201,7 +29261,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNonCloneSimpleTwinNormal( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 949, port: port_); + funcId: 951, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -29233,7 +29293,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { arg, serializer); sse_encode_i_32(expect, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 945, port: port_); + funcId: 947, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29264,7 +29324,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { arg, serializer); sse_encode_list_prim_i_32_loose(expect, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 969, port: port_); + funcId: 971, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29296,7 +29356,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNonCloneSimpleTwinNormal( b, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 977, port: port_); + funcId: 979, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_i_32, @@ -29328,7 +29388,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNonCloneSimpleTwinNormal( mutBorrow, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 976, port: port_); + funcId: 978, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_i_32, @@ -29356,7 +29416,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockBoxdynFnStringStringSendSync( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 954, port: port_); + funcId: 956, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29382,7 +29442,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 955, port: port_); + funcId: 957, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -29411,7 +29471,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNonCloneSimpleEnumTwinNormal( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 966, port: port_); + funcId: 968, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29437,7 +29497,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 967, port: port_); + funcId: 969, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -29466,7 +29526,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_box_autoadd_enum_with_good_and_opaque_twin_normal( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 963, port: port_); + funcId: 965, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29495,7 +29555,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 964, port: port_); + funcId: 966, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_enum_with_good_and_opaque_twin_normal, @@ -29525,7 +29585,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 965, port: port_); + funcId: 967, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_enum_with_good_and_opaque_twin_normal, @@ -29559,7 +29619,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { arg, serializer); sse_encode_i_32(expect, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 971, port: port_); + funcId: 973, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29586,7 +29646,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_i_32(initial, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 973, port: port_); + funcId: 975, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -29616,7 +29676,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_box_autoadd_struct_with_explicit_auto_opaque_field_twin_normal( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 972, port: port_); + funcId: 974, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29645,7 +29705,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { a, serializer); sse_encode_String(b, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 951, port: port_); + funcId: 953, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29673,7 +29733,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockBoxdynMyTraitTwinNormalSendSync( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 952, port: port_); + funcId: 954, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29699,7 +29759,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 953, port: port_); + funcId: 955, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -29726,7 +29786,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 974, port: port_); + funcId: 976, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -29753,7 +29813,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 975, port: port_); + funcId: 977, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -29781,7 +29841,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_i_32(initial, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 948, port: port_); + funcId: 950, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -29808,7 +29868,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 970, port: port_); + funcId: 972, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -29835,7 +29895,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 968, port: port_); + funcId: 970, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -29864,7 +29924,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_box_autoadd_struct_with_good_and_opaque_field_twin_normal( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 961, port: port_); + funcId: 963, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29894,7 +29954,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 962, port: port_); + funcId: 964, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -29929,7 +29989,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { arg, serializer); sse_encode_String(expect, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 957, port: port_); + funcId: 959, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29960,7 +30020,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { arg, serializer); sse_encode_String(expect, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 958, port: port_); + funcId: 960, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -29991,7 +30051,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { arg, serializer); sse_encode_String(expect, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 956, port: port_); + funcId: 958, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -30017,7 +30077,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 959, port: port_); + funcId: 961, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -30044,7 +30104,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 960, port: port_); + funcId: 962, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -30077,7 +30137,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockNonCloneSimpleTwinNormal( b, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 950, port: port_); + funcId: 952, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -30103,7 +30163,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 992, port: port_); + funcId: 994, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_enum_opaque_twin_normal_array_5, @@ -30128,7 +30188,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1001, port: port_); + funcId: 1003, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_opaque_nested_twin_normal, @@ -30153,7 +30213,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 990, port: port_); + funcId: 992, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_RustOpaque_HideDataTwinNormal, @@ -30180,7 +30240,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_opt_box_autoadd_RustOpaque_HideDataTwinNormal( opaque, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 991, port: port_); + funcId: 993, port: port_); }, codec: SseCodec( decodeSuccessData: @@ -30206,7 +30266,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1004, port: port_); + funcId: 1006, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_RustOpaque_FrbOpaqueReturnTwinNormal, @@ -30232,7 +30292,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_RustOpaque_HideDataTwinNormal_array_2(data, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 998, port: port_); + funcId: 1000, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -30256,7 +30316,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 996, port: port_); + funcId: 998, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_RustOpaque_HideDataTwinNormal_array_2, @@ -30282,7 +30342,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_list_RustOpaque_HideDataTwinNormal(data, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1000, port: port_); + funcId: 1002, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -30306,7 +30366,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 999, port: port_); + funcId: 1001, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_list_RustOpaque_HideDataTwinNormal, @@ -30332,7 +30392,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_box_autoadd_enum_opaque_twin_normal(opaque, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 993, port: port_); + funcId: 995, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_String, @@ -30358,7 +30418,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_box_autoadd_opaque_nested_twin_normal(opaque, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1002, port: port_); + funcId: 1004, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -30384,7 +30444,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_RustOpaque_NonCloneDataTwinNormal(clone, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 997, port: port_); + funcId: 999, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_String, @@ -30410,7 +30470,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_RustOpaque_HideDataTwinNormal(opaque, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 994, port: port_); + funcId: 996, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_String, @@ -30436,7 +30496,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_RustOpaque_HideDataTwinNormal(opaque, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 995, port: port_); + funcId: 997, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_String, @@ -30463,7 +30523,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_RustOpaque_HideDataTwinNormal(opaque, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1003, port: port_); + funcId: 1005, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_String, @@ -30486,7 +30546,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return handler.executeSync(SyncTask( callFfi: () { final serializer = SseSerializer(generalizedFrbRustBinding); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 1008)!; + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 1010)!; }, codec: SseCodec( decodeSuccessData: sse_decode_RustOpaque_FrbOpaqueSyncReturnTwinNormal, @@ -30510,7 +30570,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return handler.executeSync(SyncTask( callFfi: () { final serializer = SseSerializer(generalizedFrbRustBinding); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 1007)!; + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 1009)!; }, codec: SseCodec( decodeSuccessData: sse_decode_RustOpaque_NonCloneDataTwinNormal, @@ -30534,7 +30594,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return handler.executeSync(SyncTask( callFfi: () { final serializer = SseSerializer(generalizedFrbRustBinding); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 1006)!; + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 1008)!; }, codec: SseCodec( decodeSuccessData: sse_decode_RustOpaque_HideDataAnotherTwinNormal, @@ -30557,7 +30617,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return handler.executeSync(SyncTask( callFfi: () { final serializer = SseSerializer(generalizedFrbRustBinding); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 1005)!; + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 1007)!; }, codec: SseCodec( decodeSuccessData: @@ -30586,7 +30646,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_i_32(a, serializer); sse_encode_i_32(b, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1009, port: port_); + funcId: 1011, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_i_32, @@ -30610,7 +30670,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1010, port: port_); + funcId: 1012, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_String, @@ -30635,7 +30695,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1011, port: port_); + funcId: 1013, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_String, @@ -30663,7 +30723,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_u_32(a, serializer); sse_encode_u_32(b, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1012, port: port_); + funcId: 1014, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_u_32, @@ -30689,7 +30749,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: (port_) { final serializer = SseSerializer(generalizedFrbRustBinding); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1013, port: port_); + funcId: 1015, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_my_stream_entry_twin_normal, @@ -30717,7 +30777,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_u_32(key, serializer); sse_encode_u_32(max, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1014, port: port_); + funcId: 1016, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_log_twin_normal, @@ -30745,7 +30805,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_u_32(key, serializer); sse_encode_u_32(max, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1015, port: port_); + funcId: 1017, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_log_twin_normal, @@ -30773,7 +30833,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_u_32(key, serializer); sse_encode_u_32(max, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1016, port: port_); + funcId: 1018, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_log_twin_normal, @@ -30800,7 +30860,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_String(arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1017, port: port_); + funcId: 1019, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_String, @@ -30828,7 +30888,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_box_autoadd_struct_with_one_field_twin_normal( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1019, port: port_); + funcId: 1021, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_struct_with_one_field_twin_normal, @@ -30856,7 +30916,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_box_autoadd_struct_with_two_field_twin_normal( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1020, port: port_); + funcId: 1022, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_struct_with_two_field_twin_normal, @@ -30884,7 +30944,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_box_autoadd_struct_with_zero_field_twin_normal( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1018, port: port_); + funcId: 1020, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_struct_with_zero_field_twin_normal, @@ -30913,7 +30973,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_box_autoadd_tuple_struct_with_one_field_twin_normal( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1021, port: port_); + funcId: 1023, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_tuple_struct_with_one_field_twin_normal, @@ -30942,7 +31002,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_box_autoadd_tuple_struct_with_two_field_twin_normal( arg, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1022, port: port_); + funcId: 1024, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_tuple_struct_with_two_field_twin_normal, @@ -30969,7 +31029,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_list_record_string_i_32(value, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1024, port: port_); + funcId: 1026, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -30995,7 +31055,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_opt_box_autoadd_record_string_i_32(value, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1023, port: port_); + funcId: 1025, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_record_string_i_32, @@ -31020,7 +31080,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_u_64(input, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1025, port: port_); + funcId: 1027, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_u_64, @@ -31047,7 +31107,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_u_64(input, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1027, port: port_); + funcId: 1029, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_test_model_twin_normal, @@ -31074,7 +31134,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_u_64(input, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1026, port: port_); + funcId: 1028, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_u_64, @@ -31101,7 +31161,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_box_autoadd_feature_uuid_twin_normal(ids, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1029, port: port_); + funcId: 1032, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_feature_uuid_twin_normal, @@ -31128,7 +31188,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_Uuid(id, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 1028, port: port_); + funcId: 1030, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_Uuid, @@ -31146,6 +31206,32 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: ["id"], ); + @override + Future> handleUuidsTwinNormal( + {required List ids, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_list_Uuid(ids, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 1031, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_list_Uuid, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kHandleUuidsTwinNormalConstMeta, + argValues: [ids], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kHandleUuidsTwinNormalConstMeta => const TaskConstMeta( + debugName: "handle_uuids_twin_normal", + argNames: ["ids"], + ); + Future Function(int, dynamic) encode_DartFn_Inputs_DartOpaque_Output_unit( FutureOr Function(Object) raw) { @@ -36653,6 +36739,19 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return (raw as List).map(dco_decode_String).toList(); } + @protected + List dco_decode_list_Uuid(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + const kUuidSizeInBytes = 16; + final bytes = dco_decode_list_prim_u_8_strict(raw); + return List.generate( + bytes.lengthInBytes ~/ kUuidSizeInBytes, + (i) => UuidValue.fromByteList( + Uint8List.view(bytes.buffer, i * kUuidSizeInBytes, kUuidSizeInBytes)), + growable: false, + ); + } + @protected List dco_decode_list_application_env_var(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -45262,6 +45361,18 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return ans_; } + @protected + List sse_decode_list_Uuid(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var len_ = sse_decode_i_32(deserializer); + var ans_ = []; + for (var idx_ = 0; idx_ < len_; ++idx_) { + ans_.add(sse_decode_Uuid(deserializer)); + } + return ans_; + } + @protected List sse_decode_list_application_env_var( SseDeserializer deserializer) { @@ -53853,6 +53964,15 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } } + @protected + void sse_encode_list_Uuid(List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_Uuid(item, serializer); + } + } + @protected void sse_encode_list_application_env_var( List self, SseSerializer serializer) { diff --git a/frb_example/pure_dart_pde/lib/src/rust/frb_generated.io.dart b/frb_example/pure_dart_pde/lib/src/rust/frb_generated.io.dart index a50c2af390..e7739fb1b6 100644 --- a/frb_example/pure_dart_pde/lib/src/rust/frb_generated.io.dart +++ b/frb_example/pure_dart_pde/lib/src/rust/frb_generated.io.dart @@ -2371,6 +2371,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected List dco_decode_list_String(dynamic raw); + @protected + List dco_decode_list_Uuid(dynamic raw); + @protected List dco_decode_list_application_env_var(dynamic raw); @@ -5854,6 +5857,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected List sse_decode_list_String(SseDeserializer deserializer); + @protected + List sse_decode_list_Uuid(SseDeserializer deserializer); + @protected List sse_decode_list_application_env_var( SseDeserializer deserializer); @@ -9502,6 +9508,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_list_String(List self, SseSerializer serializer); + @protected + void sse_encode_list_Uuid(List self, SseSerializer serializer); + @protected void sse_encode_list_application_env_var( List self, SseSerializer serializer); diff --git a/frb_example/pure_dart_pde/lib/src/rust/frb_generated.web.dart b/frb_example/pure_dart_pde/lib/src/rust/frb_generated.web.dart index f9d82c2ca0..9ca1fa95aa 100644 --- a/frb_example/pure_dart_pde/lib/src/rust/frb_generated.web.dart +++ b/frb_example/pure_dart_pde/lib/src/rust/frb_generated.web.dart @@ -2370,6 +2370,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected List dco_decode_list_String(dynamic raw); + @protected + List dco_decode_list_Uuid(dynamic raw); + @protected List dco_decode_list_application_env_var(dynamic raw); @@ -5853,6 +5856,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected List sse_decode_list_String(SseDeserializer deserializer); + @protected + List sse_decode_list_Uuid(SseDeserializer deserializer); + @protected List sse_decode_list_application_env_var( SseDeserializer deserializer); @@ -9501,6 +9507,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_list_String(List self, SseSerializer serializer); + @protected + void sse_encode_list_Uuid(List self, SseSerializer serializer); + @protected void sse_encode_list_application_env_var( List self, SseSerializer serializer); diff --git a/frb_example/pure_dart_pde/rust/src/api/pseudo_manual/uuid_type_twin_rust_async.rs b/frb_example/pure_dart_pde/rust/src/api/pseudo_manual/uuid_type_twin_rust_async.rs index 200d269c43..10084394da 100644 --- a/frb_example/pure_dart_pde/rust/src/api/pseudo_manual/uuid_type_twin_rust_async.rs +++ b/frb_example/pure_dart_pde/rust/src/api/pseudo_manual/uuid_type_twin_rust_async.rs @@ -14,10 +14,9 @@ pub async fn handle_uuid_twin_rust_async(id: uuid::Uuid) -> anyhow::Result` is supported using SSE (serializer) -// pub async fn handle_uuids_twin_rust_async(ids: Vec) -> anyhow::Result> { -// Ok(ids) -// } +pub async fn handle_uuids_twin_rust_async(ids: Vec) -> anyhow::Result> { + Ok(ids) +} pub async fn handle_nested_uuids_twin_rust_async( ids: FeatureUuidTwinRustAsync, diff --git a/frb_example/pure_dart_pde/rust/src/api/pseudo_manual/uuid_type_twin_sync.rs b/frb_example/pure_dart_pde/rust/src/api/pseudo_manual/uuid_type_twin_sync.rs index 0d6ce41e5f..c9511a4051 100644 --- a/frb_example/pure_dart_pde/rust/src/api/pseudo_manual/uuid_type_twin_sync.rs +++ b/frb_example/pure_dart_pde/rust/src/api/pseudo_manual/uuid_type_twin_sync.rs @@ -15,10 +15,10 @@ pub fn handle_uuid_twin_sync(id: uuid::Uuid) -> anyhow::Result { Ok(id) } -// TODO: For simplicity, `Vec` is supported using SSE (serializer) -// #[flutter_rust_bridge::frb(sync)] pub fn handle_uuids_twin_sync(ids: Vec) -> anyhow::Result> { -// Ok(ids) -// } +#[flutter_rust_bridge::frb(sync)] +pub fn handle_uuids_twin_sync(ids: Vec) -> anyhow::Result> { + Ok(ids) +} #[flutter_rust_bridge::frb(sync)] pub fn handle_nested_uuids_twin_sync( diff --git a/frb_example/pure_dart_pde/rust/src/api/uuid_type.rs b/frb_example/pure_dart_pde/rust/src/api/uuid_type.rs index 034b2b650e..280eb277fd 100644 --- a/frb_example/pure_dart_pde/rust/src/api/uuid_type.rs +++ b/frb_example/pure_dart_pde/rust/src/api/uuid_type.rs @@ -10,10 +10,9 @@ pub fn handle_uuid_twin_normal(id: uuid::Uuid) -> anyhow::Result { Ok(id) } -// TODO: For simplicity, `Vec` is supported using SSE (serializer) -// pub fn handle_uuids_twin_normal(ids: Vec) -> anyhow::Result> { -// Ok(ids) -// } +pub fn handle_uuids_twin_normal(ids: Vec) -> anyhow::Result> { + Ok(ids) +} pub fn handle_nested_uuids_twin_normal( ids: FeatureUuidTwinNormal, diff --git a/frb_example/pure_dart_pde/rust/src/frb_generated.rs b/frb_example/pure_dart_pde/rust/src/frb_generated.rs index e5784bcdcf..6707dffa04 100644 --- a/frb_example/pure_dart_pde/rust/src/frb_generated.rs +++ b/frb_example/pure_dart_pde/rust/src/frb_generated.rs @@ -19180,6 +19180,21 @@ fn wire_handle_uuid_twin_rust_async_impl( })().await) } }) } +fn wire_handle_uuids_twin_rust_async_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_async::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "handle_uuids_twin_rust_async", 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); + let api_ids = >::sse_decode(&mut deserializer);deserializer.end(); move |context| async move { + transform_result_sse((move || async move { + crate::api::pseudo_manual::uuid_type_twin_rust_async::handle_uuids_twin_rust_async(api_ids).await + })().await) + } }) +} fn wire_handle_nested_uuids_twin_sync_impl( ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, rust_vec_len_: i32, @@ -19243,6 +19258,35 @@ fn wire_handle_uuid_twin_sync_impl( }, ) } +fn wire_handle_uuids_twin_sync_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: "handle_uuids_twin_sync", + 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); + let api_ids = >::sse_decode(&mut deserializer); + deserializer.end(); + transform_result_sse((move || { + crate::api::pseudo_manual::uuid_type_twin_sync::handle_uuids_twin_sync(api_ids) + })()) + }, + ) +} fn wire_test_more_than_just_one_raw_string_struct_twin_normal_impl( port_: flutter_rust_bridge::for_generated::MessagePort, ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, @@ -21688,6 +21732,38 @@ fn wire_handle_uuid_twin_normal_impl( }, ) } +fn wire_handle_uuids_twin_normal_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: "handle_uuids_twin_normal", + 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); + let api_ids = >::sse_decode(&mut deserializer); + deserializer.end(); + move |context| { + transform_result_sse((move || { + crate::api::uuid_type::handle_uuids_twin_normal(api_ids) + })()) + } + }, + ) +} // Section: wrapper_structs @@ -26242,6 +26318,18 @@ impl SseDecode for Vec { } } +impl SseDecode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(::sse_decode(deserializer)); + } + return ans_; + } +} + impl SseDecode for Vec { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -31384,91 +31472,93 @@ fn pde_ffi_dispatcher_primary_impl( 933 => wire_handle_type_alias_id_twin_rust_async_impl(port, ptr, rust_vec_len, data_len), 935 => wire_handle_type_alias_model_twin_rust_async_impl(port, ptr, rust_vec_len, data_len), 934 => wire_handle_type_nest_alias_id_twin_rust_async_impl(port, ptr, rust_vec_len, data_len), -940 => wire_handle_nested_uuids_twin_rust_async_impl(port, ptr, rust_vec_len, data_len), +941 => wire_handle_nested_uuids_twin_rust_async_impl(port, ptr, rust_vec_len, data_len), 939 => wire_handle_uuid_twin_rust_async_impl(port, ptr, rust_vec_len, data_len), -944 => wire_test_more_than_just_one_raw_string_struct_twin_normal_impl(port, ptr, rust_vec_len, data_len), -943 => wire_test_raw_string_item_struct_twin_normal_impl(port, ptr, rust_vec_len, data_len), -986 => wire_NonCloneSimpleTwinNormal_instance_method_arg_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), -987 => wire_NonCloneSimpleTwinNormal_instance_method_arg_mut_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), -985 => wire_NonCloneSimpleTwinNormal_instance_method_arg_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), -989 => wire_NonCloneSimpleTwinNormal_instance_method_getter_twin_normal_impl(port, ptr, rust_vec_len, data_len), -988 => wire_NonCloneSimpleTwinNormal_instance_method_return_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), -983 => wire_NonCloneSimpleTwinNormal_new_custom_name_twin_normal_impl(port, ptr, rust_vec_len, data_len), -982 => wire_NonCloneSimpleTwinNormal_new_twin_normal_impl(port, ptr, rust_vec_len, data_len), -984 => wire_NonCloneSimpleTwinNormal_new_with_result_twin_normal_impl(port, ptr, rust_vec_len, data_len), -979 => wire_NonCloneSimpleTwinNormal_static_method_arg_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), -980 => wire_NonCloneSimpleTwinNormal_static_method_arg_mut_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), -978 => wire_NonCloneSimpleTwinNormal_static_method_arg_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), -981 => wire_NonCloneSimpleTwinNormal_static_method_return_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), -946 => wire_rust_auto_opaque_arg_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), -947 => wire_rust_auto_opaque_arg_mut_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), -949 => wire_rust_auto_opaque_arg_own_and_return_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), -945 => wire_rust_auto_opaque_arg_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), -969 => wire_rust_auto_opaque_arg_vec_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), -977 => wire_rust_auto_opaque_borrow_and_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), -976 => wire_rust_auto_opaque_borrow_and_mut_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), -954 => wire_rust_auto_opaque_callable_arg_twin_normal_impl(port, ptr, rust_vec_len, data_len), -955 => wire_rust_auto_opaque_callable_return_twin_normal_impl(port, ptr, rust_vec_len, data_len), -966 => wire_rust_auto_opaque_enum_arg_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), -967 => wire_rust_auto_opaque_enum_return_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), -963 => wire_rust_auto_opaque_enum_with_good_and_opaque_arg_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), -964 => wire_rust_auto_opaque_enum_with_good_and_opaque_return_own_good_twin_normal_impl(port, ptr, rust_vec_len, data_len), -965 => wire_rust_auto_opaque_enum_with_good_and_opaque_return_own_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), -971 => wire_rust_auto_opaque_explicit_arg_twin_normal_impl(port, ptr, rust_vec_len, data_len), -973 => wire_rust_auto_opaque_explicit_return_twin_normal_impl(port, ptr, rust_vec_len, data_len), -972 => wire_rust_auto_opaque_explicit_struct_twin_normal_impl(port, ptr, rust_vec_len, data_len), -951 => wire_rust_auto_opaque_normal_and_opaque_arg_twin_normal_impl(port, ptr, rust_vec_len, data_len), -952 => wire_rust_auto_opaque_plus_sign_arg_twin_normal_impl(port, ptr, rust_vec_len, data_len), -953 => wire_rust_auto_opaque_plus_sign_return_twin_normal_impl(port, ptr, rust_vec_len, data_len), -974 => wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal_impl(port, ptr, rust_vec_len, data_len), -975 => wire_rust_auto_opaque_return_opaque_two_twin_normal_impl(port, ptr, rust_vec_len, data_len), -948 => wire_rust_auto_opaque_return_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), -970 => wire_rust_auto_opaque_return_vec_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), -968 => wire_rust_auto_opaque_stream_sink_twin_normal_impl(port, ptr, rust_vec_len, data_len), -961 => wire_rust_auto_opaque_struct_with_good_and_opaque_field_arg_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), -962 => wire_rust_auto_opaque_struct_with_good_and_opaque_field_return_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), -957 => wire_rust_auto_opaque_trait_object_arg_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), -958 => wire_rust_auto_opaque_trait_object_arg_mut_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), -956 => wire_rust_auto_opaque_trait_object_arg_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), -959 => wire_rust_auto_opaque_trait_object_return_own_one_twin_normal_impl(port, ptr, rust_vec_len, data_len), -960 => wire_rust_auto_opaque_trait_object_return_own_two_twin_normal_impl(port, ptr, rust_vec_len, data_len), -950 => wire_rust_auto_opaque_two_args_twin_normal_impl(port, ptr, rust_vec_len, data_len), -992 => wire_create_array_opaque_enum_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1001 => wire_create_nested_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), -990 => wire_create_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), -991 => wire_create_option_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1004 => wire_frb_generator_test_twin_normal_impl(port, ptr, rust_vec_len, data_len), -998 => wire_opaque_array_run_twin_normal_impl(port, ptr, rust_vec_len, data_len), -996 => wire_opaque_array_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1000 => wire_opaque_vec_run_twin_normal_impl(port, ptr, rust_vec_len, data_len), -999 => wire_opaque_vec_twin_normal_impl(port, ptr, rust_vec_len, data_len), -993 => wire_run_enum_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1002 => wire_run_nested_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), -997 => wire_run_non_clone_twin_normal_impl(port, ptr, rust_vec_len, data_len), -994 => wire_run_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), -995 => wire_run_opaque_with_delay_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1003 => wire_unwrap_rust_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1009 => wire_simple_adder_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1010 => wire_func_stream_return_error_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1011 => wire_func_stream_return_panic_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1012 => wire_func_stream_sink_arg_position_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1013 => wire_handle_stream_of_struct_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1014 => wire_handle_stream_sink_at_1_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1015 => wire_handle_stream_sink_at_2_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1016 => wire_handle_stream_sink_at_3_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1017 => wire_func_stream_realistic_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1019 => wire_func_struct_with_one_field_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1020 => wire_func_struct_with_two_field_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1018 => wire_func_struct_with_zero_field_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1021 => wire_func_tuple_struct_with_one_field_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1022 => wire_func_tuple_struct_with_two_field_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1024 => wire_test_tuple_2_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1023 => wire_test_tuple_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1025 => wire_handle_type_alias_id_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1027 => wire_handle_type_alias_model_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1026 => wire_handle_type_nest_alias_id_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1029 => wire_handle_nested_uuids_twin_normal_impl(port, ptr, rust_vec_len, data_len), -1028 => wire_handle_uuid_twin_normal_impl(port, ptr, rust_vec_len, data_len), +940 => wire_handle_uuids_twin_rust_async_impl(port, ptr, rust_vec_len, data_len), +946 => wire_test_more_than_just_one_raw_string_struct_twin_normal_impl(port, ptr, rust_vec_len, data_len), +945 => wire_test_raw_string_item_struct_twin_normal_impl(port, ptr, rust_vec_len, data_len), +988 => wire_NonCloneSimpleTwinNormal_instance_method_arg_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), +989 => wire_NonCloneSimpleTwinNormal_instance_method_arg_mut_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), +987 => wire_NonCloneSimpleTwinNormal_instance_method_arg_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), +991 => wire_NonCloneSimpleTwinNormal_instance_method_getter_twin_normal_impl(port, ptr, rust_vec_len, data_len), +990 => wire_NonCloneSimpleTwinNormal_instance_method_return_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), +985 => wire_NonCloneSimpleTwinNormal_new_custom_name_twin_normal_impl(port, ptr, rust_vec_len, data_len), +984 => wire_NonCloneSimpleTwinNormal_new_twin_normal_impl(port, ptr, rust_vec_len, data_len), +986 => wire_NonCloneSimpleTwinNormal_new_with_result_twin_normal_impl(port, ptr, rust_vec_len, data_len), +981 => wire_NonCloneSimpleTwinNormal_static_method_arg_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), +982 => wire_NonCloneSimpleTwinNormal_static_method_arg_mut_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), +980 => wire_NonCloneSimpleTwinNormal_static_method_arg_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), +983 => wire_NonCloneSimpleTwinNormal_static_method_return_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), +948 => wire_rust_auto_opaque_arg_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), +949 => wire_rust_auto_opaque_arg_mut_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), +951 => wire_rust_auto_opaque_arg_own_and_return_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), +947 => wire_rust_auto_opaque_arg_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), +971 => wire_rust_auto_opaque_arg_vec_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), +979 => wire_rust_auto_opaque_borrow_and_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), +978 => wire_rust_auto_opaque_borrow_and_mut_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), +956 => wire_rust_auto_opaque_callable_arg_twin_normal_impl(port, ptr, rust_vec_len, data_len), +957 => wire_rust_auto_opaque_callable_return_twin_normal_impl(port, ptr, rust_vec_len, data_len), +968 => wire_rust_auto_opaque_enum_arg_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), +969 => wire_rust_auto_opaque_enum_return_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), +965 => wire_rust_auto_opaque_enum_with_good_and_opaque_arg_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), +966 => wire_rust_auto_opaque_enum_with_good_and_opaque_return_own_good_twin_normal_impl(port, ptr, rust_vec_len, data_len), +967 => wire_rust_auto_opaque_enum_with_good_and_opaque_return_own_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), +973 => wire_rust_auto_opaque_explicit_arg_twin_normal_impl(port, ptr, rust_vec_len, data_len), +975 => wire_rust_auto_opaque_explicit_return_twin_normal_impl(port, ptr, rust_vec_len, data_len), +974 => wire_rust_auto_opaque_explicit_struct_twin_normal_impl(port, ptr, rust_vec_len, data_len), +953 => wire_rust_auto_opaque_normal_and_opaque_arg_twin_normal_impl(port, ptr, rust_vec_len, data_len), +954 => wire_rust_auto_opaque_plus_sign_arg_twin_normal_impl(port, ptr, rust_vec_len, data_len), +955 => wire_rust_auto_opaque_plus_sign_return_twin_normal_impl(port, ptr, rust_vec_len, data_len), +976 => wire_rust_auto_opaque_return_opaque_one_and_two_twin_normal_impl(port, ptr, rust_vec_len, data_len), +977 => wire_rust_auto_opaque_return_opaque_two_twin_normal_impl(port, ptr, rust_vec_len, data_len), +950 => wire_rust_auto_opaque_return_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), +972 => wire_rust_auto_opaque_return_vec_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), +970 => wire_rust_auto_opaque_stream_sink_twin_normal_impl(port, ptr, rust_vec_len, data_len), +963 => wire_rust_auto_opaque_struct_with_good_and_opaque_field_arg_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), +964 => wire_rust_auto_opaque_struct_with_good_and_opaque_field_return_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), +959 => wire_rust_auto_opaque_trait_object_arg_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), +960 => wire_rust_auto_opaque_trait_object_arg_mut_borrow_twin_normal_impl(port, ptr, rust_vec_len, data_len), +958 => wire_rust_auto_opaque_trait_object_arg_own_twin_normal_impl(port, ptr, rust_vec_len, data_len), +961 => wire_rust_auto_opaque_trait_object_return_own_one_twin_normal_impl(port, ptr, rust_vec_len, data_len), +962 => wire_rust_auto_opaque_trait_object_return_own_two_twin_normal_impl(port, ptr, rust_vec_len, data_len), +952 => wire_rust_auto_opaque_two_args_twin_normal_impl(port, ptr, rust_vec_len, data_len), +994 => wire_create_array_opaque_enum_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1003 => wire_create_nested_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), +992 => wire_create_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), +993 => wire_create_option_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1006 => wire_frb_generator_test_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1000 => wire_opaque_array_run_twin_normal_impl(port, ptr, rust_vec_len, data_len), +998 => wire_opaque_array_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1002 => wire_opaque_vec_run_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1001 => wire_opaque_vec_twin_normal_impl(port, ptr, rust_vec_len, data_len), +995 => wire_run_enum_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1004 => wire_run_nested_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), +999 => wire_run_non_clone_twin_normal_impl(port, ptr, rust_vec_len, data_len), +996 => wire_run_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), +997 => wire_run_opaque_with_delay_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1005 => wire_unwrap_rust_opaque_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1011 => wire_simple_adder_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1012 => wire_func_stream_return_error_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1013 => wire_func_stream_return_panic_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1014 => wire_func_stream_sink_arg_position_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1015 => wire_handle_stream_of_struct_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1016 => wire_handle_stream_sink_at_1_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1017 => wire_handle_stream_sink_at_2_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1018 => wire_handle_stream_sink_at_3_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1019 => wire_func_stream_realistic_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1021 => wire_func_struct_with_one_field_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1022 => wire_func_struct_with_two_field_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1020 => wire_func_struct_with_zero_field_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1023 => wire_func_tuple_struct_with_one_field_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1024 => wire_func_tuple_struct_with_two_field_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1026 => wire_test_tuple_2_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1025 => wire_test_tuple_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1027 => wire_handle_type_alias_id_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1029 => wire_handle_type_alias_model_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1028 => wire_handle_type_nest_alias_id_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1032 => wire_handle_nested_uuids_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1030 => wire_handle_uuid_twin_normal_impl(port, ptr, rust_vec_len, data_len), +1031 => wire_handle_uuids_twin_normal_impl(port, ptr, rust_vec_len, data_len), _ => unreachable!(), } } @@ -31998,12 +32088,13 @@ fn pde_ffi_dispatcher_sync_impl( 936 => wire_handle_type_alias_id_twin_sync_impl(ptr, rust_vec_len, data_len), 938 => wire_handle_type_alias_model_twin_sync_impl(ptr, rust_vec_len, data_len), 937 => wire_handle_type_nest_alias_id_twin_sync_impl(ptr, rust_vec_len, data_len), - 942 => wire_handle_nested_uuids_twin_sync_impl(ptr, rust_vec_len, data_len), - 941 => wire_handle_uuid_twin_sync_impl(ptr, rust_vec_len, data_len), - 1008 => wire_frb_sync_generator_test_twin_normal_impl(ptr, rust_vec_len, data_len), - 1007 => wire_sync_create_non_clone_twin_normal_impl(ptr, rust_vec_len, data_len), - 1006 => wire_sync_create_opaque_twin_normal_impl(ptr, rust_vec_len, data_len), - 1005 => wire_sync_option_rust_opaque_twin_normal_impl(ptr, rust_vec_len, data_len), + 944 => wire_handle_nested_uuids_twin_sync_impl(ptr, rust_vec_len, data_len), + 942 => wire_handle_uuid_twin_sync_impl(ptr, rust_vec_len, data_len), + 943 => wire_handle_uuids_twin_sync_impl(ptr, rust_vec_len, data_len), + 1010 => wire_frb_sync_generator_test_twin_normal_impl(ptr, rust_vec_len, data_len), + 1009 => wire_sync_create_non_clone_twin_normal_impl(ptr, rust_vec_len, data_len), + 1008 => wire_sync_create_opaque_twin_normal_impl(ptr, rust_vec_len, data_len), + 1007 => wire_sync_option_rust_opaque_twin_normal_impl(ptr, rust_vec_len, data_len), _ => unreachable!(), } } @@ -42056,6 +42147,16 @@ impl SseEncode for Vec { } } +impl SseEncode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } + } +} + impl SseEncode for Vec { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { diff --git a/frb_example/pure_dart_pde/test/api/pseudo_manual/uuid_type_twin_rust_async_test.dart b/frb_example/pure_dart_pde/test/api/pseudo_manual/uuid_type_twin_rust_async_test.dart index 2affcb9f32..2fa62e8497 100644 --- a/frb_example/pure_dart_pde/test/api/pseudo_manual/uuid_type_twin_rust_async_test.dart +++ b/frb_example/pure_dart_pde/test/api/pseudo_manual/uuid_type_twin_rust_async_test.dart @@ -19,14 +19,13 @@ Future main({bool skipRustLibInit = false}) async { expect(id, output); }); - // TODO: For simplicity, `Vec` is supported using SSE (serializer) - // test('Vec', () async { - // final uuid = Uuid(); - // final ids = - // List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); - // final outputs = await handleUuidsTwinRustAsync(ids: ids); - // expect(ids, outputs); - // }); + test('Vec', () async { + final uuid = Uuid(); + final ids = + List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); + final outputs = await handleUuidsTwinRustAsync(ids: ids); + expect(ids, outputs); + }); test('nested uuid types', () async { final uuid = Uuid(); diff --git a/frb_example/pure_dart_pde/test/api/pseudo_manual/uuid_type_twin_sync_test.dart b/frb_example/pure_dart_pde/test/api/pseudo_manual/uuid_type_twin_sync_test.dart index f3270df754..cfbf16e9cd 100644 --- a/frb_example/pure_dart_pde/test/api/pseudo_manual/uuid_type_twin_sync_test.dart +++ b/frb_example/pure_dart_pde/test/api/pseudo_manual/uuid_type_twin_sync_test.dart @@ -19,14 +19,13 @@ Future main({bool skipRustLibInit = false}) async { expect(id, output); }); - // TODO: For simplicity, `Vec` is supported using SSE (serializer) - // test('Vec', () async { - // final uuid = Uuid(); - // final ids = - // List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); - // final outputs = await handleUuidsTwinSync(ids: ids); - // expect(ids, outputs); - // }); + test('Vec', () async { + final uuid = Uuid(); + final ids = + List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); + final outputs = await handleUuidsTwinSync(ids: ids); + expect(ids, outputs); + }); test('nested uuid types', () async { final uuid = Uuid(); diff --git a/frb_example/pure_dart_pde/test/api/uuid_type_test.dart b/frb_example/pure_dart_pde/test/api/uuid_type_test.dart index c1ceac7e29..ab5d5639ab 100644 --- a/frb_example/pure_dart_pde/test/api/uuid_type_test.dart +++ b/frb_example/pure_dart_pde/test/api/uuid_type_test.dart @@ -15,14 +15,13 @@ Future main({bool skipRustLibInit = false}) async { expect(id, output); }); - // TODO: For simplicity, `Vec` is supported using SSE (serializer) - // test('Vec', () async { - // final uuid = Uuid(); - // final ids = - // List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); - // final outputs = await handleUuidsTwinNormal(ids: ids); - // expect(ids, outputs); - // }); + test('Vec', () async { + final uuid = Uuid(); + final ids = + List.from([uuid.v4obj(), uuid.v1obj(), uuid.v4obj()]); + final outputs = await handleUuidsTwinNormal(ids: ids); + expect(ids, outputs); + }); test('nested uuid types', () async { final uuid = Uuid();