pub struct MemoryManager {
pub store_limits: StoreLimits,
/* private fields */
}Fields§
§store_limits: StoreLimitsImplementations§
Source§impl MemoryManager
impl MemoryManager
Sourcepub fn from_limits(limits: &WasmLimits) -> Self
pub fn from_limits(limits: &WasmLimits) -> Self
Create a MemoryManager sized according to resolved WasmLimits.
Source§impl MemoryManager
impl MemoryManager
pub fn alloc(&mut self, len: usize) -> Result<usize, ContractError>
pub fn write_byte( &mut self, start_ptr: usize, offset: usize, data: u8, ) -> Result<(), ContractError>
pub fn read_byte(&self, ptr: usize) -> Result<u8, ContractError>
pub fn read_data(&self, ptr: usize) -> Result<&[u8], ContractError>
pub fn get_pointer_len(&self, ptr: usize) -> isize
pub fn add_data_raw(&mut self, bytes: &[u8]) -> Result<usize, ContractError>
Trait Implementations§
Source§impl Debug for MemoryManager
impl Debug for MemoryManager
Auto Trait Implementations§
impl Freeze for MemoryManager
impl RefUnwindSafe for MemoryManager
impl Send for MemoryManager
impl Sync for MemoryManager
impl Unpin for MemoryManager
impl UnsafeUnpin for MemoryManager
impl UnwindSafe for MemoryManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more