pub struct Buffer<'instance> { /* private fields */ }
Expand description
A live buffer in the WASM linear memory.
Implementations§
Source§impl<'instance> Buffer<'instance>
impl<'instance> Buffer<'instance>
Sourcepub unsafe fn read<T: Sized>(&mut self) -> T
pub unsafe fn read<T: Sized>(&mut self) -> T
§Safety
In order for this to be a safe T must be properly aligned and cannot re-use the buffer trying to read the same memory region again (that would create more than one copy to the same underlying data and break aliasing rules).
Sourcepub fn read_bytes(&mut self, len: usize) -> &[u8] ⓘ
pub fn read_bytes(&mut self, len: usize) -> &[u8] ⓘ
Read the specified number of bytes from the buffer.
Trait Implementations§
Auto Trait Implementations§
impl<'instance> Freeze for Buffer<'instance>
impl<'instance> RefUnwindSafe for Buffer<'instance>
impl<'instance> !Send for Buffer<'instance>
impl<'instance> !Sync for Buffer<'instance>
impl<'instance> Unpin for Buffer<'instance>
impl<'instance> !UnwindSafe for Buffer<'instance>
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