[][src]Struct redox_buffer_pool::ExpandHandle

pub struct ExpandHandle<'a, I: Integer, H: Handle, E: Copy> { /* fields omitted */ }

A handle for expansion. When this handle is retrieved by the BufferPool::begin_expand method, the range has already been reserved, so it's up to this handle to initialize it.

Implementations

impl<'a, I, H, E> ExpandHandle<'a, I, H, E> where
    I: Integer,
    H: Handle,
    E: Copy
[src]

pub fn len(&self) -> I[src]

Get the length of the range that has been reserved for this specific allocation.

pub fn is_empty(&self) -> bool[src]

Check whether the pending expansion consists of no bytes. Note that zero-sized allocations will panic anyways, so this will always return false, but is still there for completeness.

pub fn offset(&self) -> I[src]

Get the offset within the buffer pool, where this allocation is to take place.

pub unsafe fn initialize(self, pointer: NonNull<u8>, extra: E)[src]

Provide the handle with an actually allocated pointer, initializing the memory range within the buffer pool.

Safety

For this to be safe, the pointer must be a valid allocation (anywhere) of the size originally inputted. The allocation must have the static lifetime, so pointers to the stack obviously don't apply here.

Auto Trait Implementations

impl<'a, I, H, E> !RefUnwindSafe for ExpandHandle<'a, I, H, E>

impl<'a, I, H, E> Send for ExpandHandle<'a, I, H, E> where
    H: Sync,
    I: Send + Sync

impl<'a, I, H, E> Sync for ExpandHandle<'a, I, H, E> where
    H: Sync,
    I: Send + Sync

impl<'a, I, H, E> Unpin for ExpandHandle<'a, I, H, E> where
    I: Unpin

impl<'a, I, H, E> !UnwindSafe for ExpandHandle<'a, I, H, E>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.