Struct solana_rbpf::memory_region::MemoryMapping
source · [−]pub struct MemoryMapping<'a> { /* private fields */ }
Expand description
Indirection to use instead of a slice to make handling easier
Implementations
sourceimpl<'a> MemoryMapping<'a>
impl<'a> MemoryMapping<'a>
sourcepub fn new<E: UserDefinedError>(
regions: Vec<MemoryRegion>,
config: &'a Config
) -> Result<Self, EbpfError<E>>
pub fn new<E: UserDefinedError>(
regions: Vec<MemoryRegion>,
config: &'a Config
) -> Result<Self, EbpfError<E>>
Creates a new MemoryMapping structure from the given regions
sourcepub fn map<E: UserDefinedError>(
&self,
access_type: AccessType,
vm_addr: u64,
len: u64
) -> Result<u64, EbpfError<E>>
pub fn map<E: UserDefinedError>(
&self,
access_type: AccessType,
vm_addr: u64,
len: u64
) -> Result<u64, EbpfError<E>>
Given a list of regions translate from virtual machine to host address
sourcepub fn generate_access_violation<E: UserDefinedError>(
&self,
access_type: AccessType,
vm_addr: u64,
len: u64
) -> Result<u64, EbpfError<E>>
pub fn generate_access_violation<E: UserDefinedError>(
&self,
access_type: AccessType,
vm_addr: u64,
len: u64
) -> Result<u64, EbpfError<E>>
Helper for map to generate errors
sourcepub fn resize_region<E: UserDefinedError>(
&mut self,
index: usize,
new_len: u64
) -> Result<(), EbpfError<E>>
pub fn resize_region<E: UserDefinedError>(
&mut self,
index: usize,
new_len: u64
) -> Result<(), EbpfError<E>>
Resize the memory_region at the given index
Auto Trait Implementations
impl<'a> RefUnwindSafe for MemoryMapping<'a>
impl<'a> Send for MemoryMapping<'a>
impl<'a> Sync for MemoryMapping<'a>
impl<'a> Unpin for MemoryMapping<'a>
impl<'a> UnwindSafe for MemoryMapping<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more