pub struct Buffer { /* private fields */ }Implementations§
Source§impl Buffer
impl Buffer
Sourcepub const unsafe fn from_raw(raw: NonNull<RawBuffer>) -> Self
pub const unsafe fn from_raw(raw: NonNull<RawBuffer>) -> Self
Constructs a non-owning buffer handle.
§Safety
raw must address a live buffer allocated by the owning VM. The caller
must not use the handle after the buffer is collected or freed.
pub const fn size_buffer(len: usize) -> usize
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub const fn data_ptr(&self) -> *const u8
Sourcepub unsafe fn data_mut_ptr(&self) -> *mut u8
pub unsafe fn data_mut_ptr(&self) -> *mut u8
Returns the mutable payload address without creating a reference.
§Safety
The buffer must remain live and the caller must enforce aliasing for every access through the returned pointer.
Trait Implementations§
impl Copy for Buffer
Auto Trait Implementations§
impl !Send for Buffer
impl !Sync for Buffer
impl Freeze for Buffer
impl RefUnwindSafe for Buffer
impl Unpin for Buffer
impl UnsafeUnpin for Buffer
impl UnwindSafe for Buffer
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