Struct MemoryStateItemMut
pub struct MemoryStateItemMut<'m> { /* private fields */ }
Expand description
A mutable reference to a memory mapping in MemoryState
.
Implementations§
§impl MemoryStateItemMut<'_>
impl MemoryStateItemMut<'_>
pub fn set_data(&mut self, new_data: &[u8])
pub fn set_data(&mut self, new_data: &[u8])
Replaces the current data in the memory mapping with new_data
.
pub fn modify_data(&mut self, f: impl FnOnce(&mut [u8]))
pub fn modify_data(&mut self, f: impl FnOnce(&mut [u8]))
Allows the data in the memory mapping to be modified through a &mut
pointer.
pub fn crop_data(&mut self, max_size: usize)
pub fn crop_data(&mut self, max_size: usize)
Crops or extends the data in the mapping to be exactly max_size
bytes.
pub fn permissions(&self) -> Permissions
pub fn permissions(&self) -> Permissions
Returns the permissions of the mapping.
Auto Trait Implementations§
impl<'m> Freeze for MemoryStateItemMut<'m>
impl<'m> RefUnwindSafe for MemoryStateItemMut<'m>
impl<'m> Send for MemoryStateItemMut<'m>
impl<'m> Sync for MemoryStateItemMut<'m>
impl<'m> Unpin for MemoryStateItemMut<'m>
impl<'m> !UnwindSafe for MemoryStateItemMut<'m>
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
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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