From 55e70b4771f29d1b1cd4e8353e76ea2509610372 Mon Sep 17 00:00:00 2001 From: Donghyun Kim Date: Sun, 9 Jun 2024 17:15:21 +0900 Subject: [PATCH 1/2] Add doc comments for `RustSignal` fields --- flutter_ffi_plugin/lib/src/interface.dart | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/flutter_ffi_plugin/lib/src/interface.dart b/flutter_ffi_plugin/lib/src/interface.dart index f7676b79..a3bc1c8a 100644 --- a/flutter_ffi_plugin/lib/src/interface.dart +++ b/flutter_ffi_plugin/lib/src/interface.dart @@ -10,7 +10,13 @@ typedef HandleRustSignal = void Function(int, Uint8List, Uint8List); /// This type is generic, and the message /// can be of any type declared in Protobuf. class RustSignal { - T message; - Uint8List binary; + /// The message instance of a class generated by Protobuf. + final T message; + + /// Binary data included in the signal. + /// This field is useful for sending custom bytes + /// without the overhead of serialization/deserialization. + final Uint8List binary; + RustSignal(this.message, this.binary); } From 4557ca865906430c32d926c61489fb0fa734c179 Mon Sep 17 00:00:00 2001 From: Donghyun Kim Date: Sun, 9 Jun 2024 17:16:55 +0900 Subject: [PATCH 2/2] Add doc comments for `DartSignal` fields --- rust_crate/src/interface.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rust_crate/src/interface.rs b/rust_crate/src/interface.rs index 27ba0420..cd18338d 100644 --- a/rust_crate/src/interface.rs +++ b/rust_crate/src/interface.rs @@ -10,7 +10,11 @@ use super::interface_web::*; /// This type is generic, and the message /// can be of any type declared in Protobuf. pub struct DartSignal { + /// The message instance of a struct generated by Protobuf. pub message: T, + /// Binary data included in the signal. + /// This field is useful for sending custom bytes + /// without the overhead of serialization/deserialization. pub binary: Vec, }