Struct neotron_common_bios::FfiByteSlice
source · #[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 copy 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>
source§fn partial_cmp(&self, rhs: &FfiByteSlice<'a>) -> Option<Ordering>
fn partial_cmp(&self, rhs: &FfiByteSlice<'a>) -> Option<Ordering>
Compare two ApiByteSlices.
We are Ord
so we can defer to that.
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'a> Eq for FfiByteSlice<'a>
Auto Trait Implementations§
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