Struct MAPIBuffer

Source
pub struct MAPIBuffer<'a, T>(/* private fields */)
where
    T: Sized;
Expand description

Wrapper type for an allocation in MAPIUninit which has been fully initialized.

Implementations§

Source§

impl<'a, T> MAPIBuffer<'a, T>

Source

pub fn chain<P>( &self, count: usize, ) -> Result<MAPIUninit<'a, P>, MAPIAllocError>

Create a new allocation with enough room for count elements of type P with a call to sys::MAPIAllocateMore. The result is a separate allocation that is not freed until self is dropped at the beginning of the chain.

You may call MAPIBuffer::chain on the result as well, they will both share a root allocation created with MAPIUninit::new.

Source

pub fn as_mut(&mut self) -> Result<&mut T, MAPIAllocError>

Access a single element of type T once it has been initialized with MAPIUninit::assume_init.

Auto Trait Implementations§

§

impl<'a, T> Freeze for MAPIBuffer<'a, T>

§

impl<'a, T> RefUnwindSafe for MAPIBuffer<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> !Send for MAPIBuffer<'a, T>

§

impl<'a, T> !Sync for MAPIBuffer<'a, T>

§

impl<'a, T> Unpin for MAPIBuffer<'a, T>

§

impl<'a, T> UnwindSafe for MAPIBuffer<'a, T>
where T: RefUnwindSafe,

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.