Skip to content

Commit

Permalink
Add the DartNativeExternalTypedData to enable sending raw buffers wit…
Browse files Browse the repository at this point in the history
…h zero copy
  • Loading branch information
jerel committed Aug 20, 2021
1 parent 2e7a25e commit 768761c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ pub union DartCObjectValue {
pub as_capability: DartNativeCapability,
pub as_array: DartNativeArray,
pub as_typed_data: DartNativeTypedData,
pub as_external_typed_data: DartNativeExternalTypedData,
_bindgen_union_align: [u64; 5usize],
}

Expand Down Expand Up @@ -110,6 +111,16 @@ pub struct DartNativeTypedData {
pub values: *mut u8,
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct DartNativeExternalTypedData {
pub ty: DartTypedDataType,
pub length: isize,
pub data: *mut u8,
pub peer: *mut u8,
pub callback: unsafe extern "C" fn(isize, *mut u8),
}

/// Posts a message on some port. The message will contain the
/// Dart_CObject object graph rooted in 'message'.
///
Expand Down

0 comments on commit 768761c

Please sign in to comment.