pub struct Memory { /* private fields */ }Implementations§
Source§impl Memory
impl Memory
Sourcepub fn new(min: u16, max: Option<u16>) -> Self
pub fn new(min: u16, max: Option<u16>) -> Self
min is the minimum amount of pages that are allocated at initialization
Initial page count may be higher than min if the initialized data is more than the pagecount allows for
max is maximum amount of pages available at runtime
Sourcepub fn push<T: Into<u8>>(&mut self, data: T) -> usize
pub fn push<T: Into<u8>>(&mut self, data: T) -> usize
Push a byte of static data and return the wasm pointer of it
Sourcepub fn extend_from_slice(&mut self, slice: &[u8]) -> usize
pub fn extend_from_slice(&mut self, slice: &[u8]) -> usize
Push a slice of static data and return the wasm pointer of it
Sourcepub fn extend_from_iter<I: IntoIterator<Item = u8>>(&mut self, data: I) -> usize
pub fn extend_from_iter<I: IntoIterator<Item = u8>>(&mut self, data: I) -> usize
Push the content of a IntoIterator<Item = u8> and return the wasm pointer of it
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Memory
impl RefUnwindSafe for Memory
impl Send for Memory
impl Sync for Memory
impl Unpin for Memory
impl UnwindSafe for Memory
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