#[repr(C)]
pub struct GuestMemoryConfig { /* private fields */ }
Expand description

The memory configuration used by a given guest program.

Implementations§

source§

impl GuestMemoryConfig

source

pub const fn empty() -> Self

source

pub const fn new( ro_data_size: u64, rw_data_size: u64, bss_size: u64, stack_size: u64 ) -> Result<Self, &'static str>

source

pub const fn user_memory_address(self) -> u32

The address at where the program memory starts inside of the VM.

source

pub const fn user_memory_size(self) -> u32

The size of the program memory inside of the VM, excluding the stack.

source

pub fn clear_user_memory_size(&mut self)

Resets the size of the program memory to zero, excluding the stack.

source

pub const fn ro_data_address(self) -> u32

The address at where the program’s read-only data starts inside of the VM.

source

pub const fn ro_data_size(self) -> u32

The size of the program’s read-only data.

source

pub const fn ro_data_range(self) -> Range<u32>

The range of addresses where the program’s read-only data is inside of the VM.

source

pub fn set_ro_data_size( &mut self, ro_data_size: u32 ) -> Result<(), &'static str>

Sets the program’s read-only data size.

source

pub const fn rw_data_address(self) -> u32

The address at where the program’s read-write data starts inside of the VM.

source

pub const fn rw_data_size(self) -> u32

source

pub fn set_rw_data_size( &mut self, rw_data_size: u32 ) -> Result<(), &'static str>

Sets the program’s read-write data size.

source

pub const fn bss_address(self) -> u32

The address at where the program’s BSS section starts inside of the VM.

source

pub const fn bss_size(self) -> u32

source

pub fn set_bss_size(&mut self, bss_size: u32) -> Result<(), &'static str>

Sets the program’s BSS section size.

source

pub const fn stack_address_low(self) -> u32

The address at where the program’s stack starts inside of the VM.

source

pub const fn stack_address_high(self) -> u32

The address at where the program’s stack ends inside of the VM.

source

pub const fn stack_size(self) -> u32

source

pub const fn stack_range(self) -> Range<u32>

source

pub fn set_stack_size(&mut self, stack_size: u32) -> Result<(), &'static str>

Sets the program’s stack size.

source

pub fn clear_stack_size(&mut self)

source

pub const fn heap_address(self) -> u32

The address at where the program’s read-write memory starts inside of the VM.

source

pub const fn heap_size(self) -> u32

The total size of the program’s read-write memory, excluding the stack.

source

pub const fn heap_range(self) -> Range<u32>

Trait Implementations§

source§

impl Clone for GuestMemoryConfig

source§

fn clone(&self) -> GuestMemoryConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl PartialEq<GuestMemoryConfig> for GuestMemoryConfig

source§

fn eq(&self, other: &GuestMemoryConfig) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for GuestMemoryConfig

source§

impl Eq for GuestMemoryConfig

source§

impl StructuralEq for GuestMemoryConfig

source§

impl StructuralPartialEq for GuestMemoryConfig

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.