Skip to main content

PageBuf

Struct PageBuf 

Source
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>

Source

pub fn new(capacity: usize) -> Result<Self, Status>

Create a new PageBuf in the calling process’ root VMAR.

Source

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

Source

pub fn set_name(&self, name: &Name)

Set the name of the buffer’s VMO.

Source

pub fn len(&self) -> usize

Source

pub fn len_bytes(&self) -> usize

Source

pub fn as_mut(&mut self) -> &mut [MaybeUninit<T>]

Return a mutable reference to the underlying memory.

Trait Implementations§

Source§

impl<T: Debug> Debug for PageBuf<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Drop for PageBuf<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T: Send> Send for PageBuf<T>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.