[][src]Struct lucet_module::SparseData

pub struct SparseData<'a> { /* fields omitted */ }

A sparse representation of a Lucet module's initial heap.

The lifetime parameter exists to support zero-copy deserialization for the &[u8] slices representing non-zero pages. For a variant with owned Vec<u8> pages, see OwnedSparseData.

Methods

impl<'a> SparseData<'a>[src]

pub fn new(pages: Vec<Option<&'a [u8]>>) -> Result<Self, Error>[src]

Create a new SparseData from its constituent pages.

Entries in the pages argument which are Some must contain a slice of exactly the host page size (4096), otherwise this function returns Error::IncorrectPageSize. Entries which are None are interpreted as empty pages, which will be zeroed by the runtime.

pub fn pages(&self) -> &[Option<&'a [u8]>][src]

pub fn get_page(&self, offset: usize) -> &Option<&'a [u8]>[src]

pub fn len(&self) -> usize[src]

Trait Implementations

impl<'a> Clone for SparseData<'a>[src]

impl<'a> Debug for SparseData<'a>[src]

impl<'de: 'a, 'a> Deserialize<'de> for SparseData<'a>[src]

impl<'a> Serialize for SparseData<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for SparseData<'a>

impl<'a> Send for SparseData<'a>

impl<'a> Sync for SparseData<'a>

impl<'a> Unpin for SparseData<'a>

impl<'a> UnwindSafe for SparseData<'a>

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.