Skip to content

Commit

Permalink
Merge pull request #362 from cunarist/add-dart-doc-comments
Browse files Browse the repository at this point in the history
Add doc comments for `DartSignal` and `RustSignal` fields
  • Loading branch information
temeddix authored Jun 9, 2024
2 parents 98a8001 + 4557ca8 commit 4e7fa42
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions flutter_ffi_plugin/lib/src/interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
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);
}
4 changes: 4 additions & 0 deletions rust_crate/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> {
/// 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<u8>,
}

Expand Down

0 comments on commit 4e7fa42

Please sign in to comment.