pub struct SsabData { /* private fields */ }Expand description
The bytes of an .ssab, owned or borrowed from the caller.
Implementations§
Source§impl SsabData
impl SsabData
Sourcepub fn load_copy(ssab_data: &[u8]) -> Result<Self, SSRuntimeError>
pub fn load_copy(ssab_data: &[u8]) -> Result<Self, SSRuntimeError>
Holds a copy of ssab_data.
Sourcepub unsafe fn load_borrow(
ptr: *const u8,
len: usize,
) -> Result<Self, SSRuntimeError>
pub unsafe fn load_borrow( ptr: *const u8, len: usize, ) -> Result<Self, SSRuntimeError>
Refers to the len bytes at ptr in place, with no copy.
§Safety
The caller must ensure:
ptris non-null and points to a valid memory block of at leastlenbytes.- The memory remains valid and unmodified for the lifetime of the returned
SsabData(and anySsabResourcederived from it). - If the resulting
SsabDatais sent to or shared with another thread, no other party may mutate the memory for the duration of the borrow.
Returns SSRuntimeError::InvalidParameter if ptr is null.
Auto Trait Implementations§
impl Freeze for SsabData
impl RefUnwindSafe for SsabData
impl Send for SsabData
impl Sync for SsabData
impl Unpin for SsabData
impl UnsafeUnpin for SsabData
impl UnwindSafe for SsabData
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