#[repr(C)]pub struct StdAllocator;Available on crate feature
std only.Expand description
The standard allocator based on alloc crate.
Trait Implementations§
Source§impl Allocator for StdAllocator
impl Allocator for StdAllocator
Source§type SpecificAllocationError = StdAllocationError
type SpecificAllocationError = StdAllocationError
A specific Allocator error. Implementor can add additional
information to the error, not only generic “allocation failed”.
Source§fn allocate(
&mut self,
layout: Layout,
) -> Result<NonNull<u8>, Self::SpecificAllocationError>
fn allocate( &mut self, layout: Layout, ) -> Result<NonNull<u8>, Self::SpecificAllocationError>
Allocates new piece of memory. This is the only safe
function here. The returned
ptr is guaranteed to satisfy
layout requirements (although the implementation is free
to overallocate and strengthen alignment). Read moreSource§impl Clone for StdAllocator
impl Clone for StdAllocator
Source§fn clone(&self) -> StdAllocator
fn clone(&self) -> StdAllocator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StdAllocator
Source§impl Debug for StdAllocator
impl Debug for StdAllocator
Source§impl Default for StdAllocator
impl Default for StdAllocator
Source§fn default() -> StdAllocator
fn default() -> StdAllocator
Returns the “default value” for a type. Read more
impl Eq for StdAllocator
Source§impl PartialEq for StdAllocator
impl PartialEq for StdAllocator
Source§fn eq(&self, other: &StdAllocator) -> bool
fn eq(&self, other: &StdAllocator) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl ReprC for StdAllocator
impl ReprC for StdAllocator
impl StructuralPartialEq for StdAllocator
Auto Trait Implementations§
impl Freeze for StdAllocator
impl RefUnwindSafe for StdAllocator
impl Send for StdAllocator
impl Sync for StdAllocator
impl Unpin for StdAllocator
impl UnsafeUnpin for StdAllocator
impl UnwindSafe for StdAllocator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more