pub struct PageBuf<T> { /* private fields */ }Expand description
A buffer backed by a VMO mapped into the root VMAR.
Optionally maps the buffer into a second VMAR as read-only to allow pinning memory in advance of support for partial VMAR profiles or a similar feature.
Implementations§
Source§impl<T> PageBuf<T>
impl<T> PageBuf<T>
Sourcepub fn new(capacity: usize) -> Result<Self, Status>
pub fn new(capacity: usize) -> Result<Self, Status>
Create a new PageBuf in the calling process’ root VMAR.
Sourcepub fn new_with_extra_vmar(
capacity: usize,
extra_vmar: Arc<Vmar>,
) -> Result<Self, Status>
pub fn new_with_extra_vmar( capacity: usize, extra_vmar: Arc<Vmar>, ) -> Result<Self, Status>
Create a new PageBuf in the calling process’ root VMAR and also map the VMO into the
provided “extra” VMAR. If the extra VMAR has a memory profile this will
pub fn len(&self) -> usize
pub fn len_bytes(&self) -> usize
Sourcepub fn as_mut(&mut self) -> &mut [MaybeUninit<T>]
pub fn as_mut(&mut self) -> &mut [MaybeUninit<T>]
Return a mutable reference to the underlying memory.
Trait Implementations§
impl<T: Send> Send for PageBuf<T>
impl<T: Sync> Sync for PageBuf<T>
Auto Trait Implementations§
impl<T> Freeze for PageBuf<T>
impl<T> RefUnwindSafe for PageBuf<T>where
T: RefUnwindSafe,
impl<T> Unpin for PageBuf<T>where
T: Unpin,
impl<T> UnsafeUnpin for PageBuf<T>
impl<T> UnwindSafe for PageBuf<T>where
T: UnwindSafe,
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