PageSegmentOps

Trait PageSegmentOps 

Source
pub trait PageSegmentOps {
    // Required methods
    fn page(&self) -> &[u8];
    fn page_mut(&mut self) -> &mut [u8];
    fn page_address(&self) -> u64;
    fn set_page_address(&mut self, address: u64);
}
Expand description

An import/export segment that stores an inner VM page and its address.

The page is stored in the first 4096 bytes, the address is encoded using little-endian format in the last 8 bytes of the segment.

[ page(4096) | address(8) ]

Required Methods§

Source

fn page(&self) -> &[u8]

Get immutable reference to the page contents (excluding the address).

Source

fn page_mut(&mut self) -> &mut [u8]

Get mutable reference to the page contents (excluding the address).

Source

fn page_address(&self) -> u64

Get the address.

Source

fn set_page_address(&mut self, address: u64)

Set the address.

Implementations on Foreign Types§

Source§

impl PageSegmentOps for Segment

Source§

fn page(&self) -> &[u8]

Source§

fn page_mut(&mut self) -> &mut [u8]

Source§

fn page_address(&self) -> u64

Source§

fn set_page_address(&mut self, address: u64)

Source§

impl PageSegmentOps for [u8]

Source§

fn page(&self) -> &[u8]

Source§

fn page_mut(&mut self) -> &mut [u8]

Source§

fn page_address(&self) -> u64

Source§

fn set_page_address(&mut self, address: u64)

Implementors§