Struct Memory
pub struct Memory {}Implementations§
§impl Memory
impl Memory
pub fn mmap(size: u64, flags: MmapFlags, permission: Perm) -> Option<Chunk>
pub fn mmap(size: u64, flags: MmapFlags, permission: Perm) -> Option<Chunk>
Allocates a memory chunk through mmap-like function
pub fn mprotect(chunk: &mut Chunk, perm: Perm) -> Result<(), Error>
pub fn mprotect(chunk: &mut Chunk, perm: Perm) -> Result<(), Error>
Sets the permission of the given memory chunk
pub unsafe fn read<T>(addr: u64) -> T
pub unsafe fn read<T>(addr: u64) -> T
Reads a value of type T from a raw memory address.
§Safety
This function is unsafe and the caller must ensure that the operation is valid
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