pub struct StorageVTable { /* private fields */ }Expand description
Functions that give Bytes access to externally owned data.
Every function receives the (addr, len) pair returned by
StorageExt::create, or by a previous clone.
Implementations§
Source§impl StorageVTable
impl StorageVTable
Sourcepub const fn new(
as_ptr: unsafe fn(*const u8, usize) -> *const u8,
len: unsafe fn(*const u8, usize) -> usize,
clone: unsafe fn(*const u8, usize) -> Option<(*const u8, usize)>,
drop: unsafe fn(*const u8, usize),
) -> StorageVTable
pub const fn new( as_ptr: unsafe fn(*const u8, usize) -> *const u8, len: unsafe fn(*const u8, usize) -> usize, clone: unsafe fn(*const u8, usize) -> Option<(*const u8, usize)>, drop: unsafe fn(*const u8, usize), ) -> StorageVTable
Creates a vtable from its functions.
as_ptrreturns a pointer to the start of the data.lenreturns the length of the data in bytes.clonereturns the(addr, len)pair of a new handle to the same data, orNoneto make the clone copy the data instead.dropreleases the handle.
The requirements these functions must meet are listed on
StorageExt.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StorageVTable
impl RefUnwindSafe for StorageVTable
impl Send for StorageVTable
impl Sync for StorageVTable
impl Unpin for StorageVTable
impl UnsafeUnpin for StorageVTable
impl UnwindSafe for StorageVTable
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