[][src]Struct bumpalo_herd::Member

pub struct Member<'h> { /* fields omitted */ }

A proxy for a Bump.

You get one by Herd::get.

The purpose is twofold:

  • To return the inner Bump back to its Herd once this proxy is dropped.
  • To allow allocation of objects with lifetime tied to the Herd.

Note

  • Not all the allocation methods are exposed right now. If the others are needed, you're welcome to send a PR.
  • The allocation methods are not documented here. They however correspond 1:1 to the same-named methods on Bump. See their documentation.

Implementations

impl<'h> Member<'h>[src]

pub fn alloc<T>(&self, val: T) -> &'h mut T[src]

pub fn alloc_with<T, F: FnOnce() -> T>(&self, f: F) -> &'h mut T[src]

pub fn alloc_str(&self, src: &str) -> &'h mut str[src]

pub fn alloc_slice_clone<T: Clone>(&self, src: &[T]) -> &'h mut [T][src]

pub fn alloc_slice_copy<T: Copy>(&self, src: &[T]) -> &'h mut [T][src]

pub fn alloc_slice_fill_clone<T: Clone>(
    &self,
    len: usize,
    value: &T
) -> &'h mut [T]
[src]

pub fn alloc_slice_fill_copy<T: Copy>(
    &self,
    len: usize,
    value: T
) -> &'h mut [T]
[src]

pub fn alloc_slice_fill_default<T: Default>(&self, len: usize) -> &'h mut [T][src]

pub fn alloc_slice_fill_with<T, F: FnMut(usize) -> T>(
    &self,
    len: usize,
    f: F
) -> &'h mut [T]
[src]

pub fn alloc_slice_fill_iter<T, I>(&self, iter: I) -> &'h mut [T] where
    I: IntoIterator<Item = T>,
    I::IntoIter: ExactSizeIterator
[src]

pub fn alloc_layout(&self, layout: Layout) -> NonNull<u8>[src]

impl<'h> Member<'h>[src]

pub fn as_bump(&self) -> &Bump[src]

Access the Bump inside.

This can be used to get the Bump allocator itself, if something needs the specific type. Note that the lifetime of the Bump and the values allocated from these is tied to this Member, not to the Herd.

As this is going to be used rarely and potentially does something else then desired (eg. the shorter lifetime), this is an explicit method, not Deref.

Trait Implementations

impl<'_> Drop for Member<'_>[src]

Auto Trait Implementations

impl<'h> !RefUnwindSafe for Member<'h>

impl<'h> Send for Member<'h>

impl<'h> !Sync for Member<'h>

impl<'h> Unpin for Member<'h>

impl<'h> !UnwindSafe for Member<'h>

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.