[−][src]Struct lucet_module::SparseData
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]
fn clone(&self) -> SparseData<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Debug for SparseData<'a>
[src]
impl<'de: 'a, 'a> Deserialize<'de> for SparseData<'a>
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,