#[repr(C)]pub struct FfiByteSlice<'a> {
pub data: *const u8,
pub data_len: usize,
/* private fields */
}
Expand description
A Rust u8 slice, but compatible with FFI. Assume the lifetime is only valid until the callee returns to the caller.
Fields§
§data: *const u8
A pointer to the data
data_len: usize
The number of bytes we are pointing at
Implementations§
Source§impl<'a> FfiByteSlice<'a>
impl<'a> FfiByteSlice<'a>
Sourcepub fn new(s: &'a [u8]) -> FfiByteSlice<'a>
pub fn new(s: &'a [u8]) -> FfiByteSlice<'a>
Create a new byte slice we can send over the FFI.
Sourcepub fn empty() -> FfiByteSlice<'static>
pub fn empty() -> FfiByteSlice<'static>
Make an empty slice.
Trait Implementations§
Source§impl<'a> Clone for FfiByteSlice<'a>
impl<'a> Clone for FfiByteSlice<'a>
Source§fn clone(&self) -> FfiByteSlice<'a>
fn clone(&self) -> FfiByteSlice<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FfiByteSlice<'_>
impl Debug for FfiByteSlice<'_>
Source§impl<'a> From<&'a [u8]> for FfiByteSlice<'a>
impl<'a> From<&'a [u8]> for FfiByteSlice<'a>
Source§fn from(input: &'a [u8]) -> FfiByteSlice<'a>
fn from(input: &'a [u8]) -> FfiByteSlice<'a>
Convert from a Rust byte slice into an FFI compatible byte slice
Source§impl<'a> Ord for FfiByteSlice<'a>
impl<'a> Ord for FfiByteSlice<'a>
Source§fn cmp(&self, rhs: &FfiByteSlice<'a>) -> Ordering
fn cmp(&self, rhs: &FfiByteSlice<'a>) -> Ordering
Compare two ApiByteSlices.
We just make some actual slices and compare then.
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialEq for FfiByteSlice<'a>
impl<'a> PartialEq for FfiByteSlice<'a>
Source§fn eq(&self, rhs: &FfiByteSlice<'a>) -> bool
fn eq(&self, rhs: &FfiByteSlice<'a>) -> bool
Check if two ApiByteSlices are equal.
We just make some actual slices and compare then.
Source§impl<'a> PartialOrd for FfiByteSlice<'a>
impl<'a> PartialOrd for FfiByteSlice<'a>
impl<'a> Eq for FfiByteSlice<'a>
Auto Trait Implementations§
impl<'a> Freeze for FfiByteSlice<'a>
impl<'a> RefUnwindSafe for FfiByteSlice<'a>
impl<'a> !Send for FfiByteSlice<'a>
impl<'a> !Sync for FfiByteSlice<'a>
impl<'a> Unpin for FfiByteSlice<'a>
impl<'a> UnwindSafe for FfiByteSlice<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more