pub struct OwnedSparseData { /* private fields */ }Expand description
A sparse representation of a Lucet module’s initial heap.
This is a version of SparseData with owned Vec<u8>s
representing pages. This type is useful when directly building up a value to be serialized.
Implementations§
Source§impl OwnedSparseData
impl OwnedSparseData
Sourcepub fn new(pages: Vec<Option<Vec<u8>>>) -> Result<Self, Error>
pub fn new(pages: Vec<Option<Vec<u8>>>) -> Result<Self, Error>
Create a new OwnedSparseData from its consitutent pages.
Entries in the pages argument which are Some must contain a vector 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.
Sourcepub fn to_ref<'a>(&'a self) -> SparseData<'a>
pub fn to_ref<'a>(&'a self) -> SparseData<'a>
Create a SparseData backed by the values in this
OwnedSparseData.
Auto Trait Implementations§
impl Freeze for OwnedSparseData
impl RefUnwindSafe for OwnedSparseData
impl Send for OwnedSparseData
impl Sync for OwnedSparseData
impl Unpin for OwnedSparseData
impl UnwindSafe for OwnedSparseData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more