[−][src]Struct bumpalo_herd::Member
A proxy for a Bump
.
You get one by Herd::get
.
The purpose is twofold:
- To return the inner
Bump
back to itsHerd
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]
&self,
len: usize,
value: &T
) -> &'h mut [T]
pub fn alloc_slice_fill_copy<T: Copy>(
&self,
len: usize,
value: T
) -> &'h mut [T]
[src]
&self,
len: usize,
value: T
) -> &'h mut [T]
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]
&self,
len: usize,
f: F
) -> &'h mut [T]
pub fn alloc_slice_fill_iter<T, I>(&self, iter: I) -> &'h mut [T] where
I: IntoIterator<Item = T>,
I::IntoIter: ExactSizeIterator,
[src]
I: IntoIterator<Item = T>,
I::IntoIter: ExactSizeIterator,
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,