pub trait BumpAllocatorTypedScopeExt<'a>: BumpAllocatorTypedScope<'a> {
// Provided methods
fn alloc_zeroed<T>(&self) -> BumpBox<'a, T> ⓘ
where T: FromZeros { ... }
fn try_alloc_zeroed<T>(&self) -> Result<BumpBox<'a, T>, AllocError>
where T: FromZeros { ... }
fn alloc_zeroed_slice<T>(&self, len: usize) -> BumpBox<'a, [T]> ⓘ
where T: FromZeros { ... }
fn try_alloc_zeroed_slice<T>(
&self,
len: usize,
) -> Result<BumpBox<'a, [T]>, AllocError>
where T: FromZeros { ... }
}Expand description
Extension trait for BumpAllocatorTypedScope that adds the (try_)alloc_zeroed(_slice) methods.
Provided Methods§
Sourcefn alloc_zeroed<T>(&self) -> BumpBox<'a, T> ⓘwhere
T: FromZeros,
fn alloc_zeroed<T>(&self) -> BumpBox<'a, T> ⓘwhere
T: FromZeros,
Sourcefn try_alloc_zeroed<T>(&self) -> Result<BumpBox<'a, T>, AllocError>where
T: FromZeros,
fn try_alloc_zeroed<T>(&self) -> Result<BumpBox<'a, T>, AllocError>where
T: FromZeros,
Sourcefn try_alloc_zeroed_slice<T>(
&self,
len: usize,
) -> Result<BumpBox<'a, [T]>, AllocError>where
T: FromZeros,
fn try_alloc_zeroed_slice<T>(
&self,
len: usize,
) -> Result<BumpBox<'a, [T]>, AllocError>where
T: FromZeros,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.