Struct solana_rbpf::memory_region::MemoryRegion[][src]

pub struct MemoryRegion {
    pub host_addr: u64,
    pub vm_addr: u64,
    pub len: u64,
    pub vm_gap_shift: u8,
    pub is_writable: bool,
}

Memory region for bounds checking and address translation

Fields

host_addr: u64

start host address

vm_addr: u64

start virtual address

len: u64

Length in bytes

vm_gap_shift: u8

Size of regular gaps as bit shift (63 means this region is continuous)

is_writable: bool

Is also writable (otherwise it is readonly)

Implementations

impl MemoryRegion[src]

pub fn new_from_slice(
    v: &[u8],
    vm_addr: u64,
    vm_gap_size: u64,
    is_writable: bool
) -> Self
[src]

Creates a new MemoryRegion structure from a slice

pub fn vm_to_host<E: UserDefinedError>(
    &self,
    vm_addr: u64,
    len: u64
) -> Result<u64, EbpfError<E>>
[src]

Convert a virtual machine address into a host address Does not perform a lower bounds check, as that is already done by the binary search in MemoryMapping::map()

Trait Implementations

impl Clone for MemoryRegion[src]

impl Debug for MemoryRegion[src]

impl Default for MemoryRegion[src]

impl Eq for MemoryRegion[src]

impl Ord for MemoryRegion[src]

impl PartialEq<MemoryRegion> for MemoryRegion[src]

impl PartialOrd<MemoryRegion> for MemoryRegion[src]

impl StructuralEq for MemoryRegion[src]

impl StructuralPartialEq for MemoryRegion[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,