Struct PoolAlloc

Source
pub struct PoolAlloc;

Trait Implementations§

Source§

impl Allocator for PoolAlloc

Source§

unsafe fn alloc_buf<F>(&self, layout: Layout, f: F) -> Result<NonNull<[u8]>>
where F: FnOnce(NonNull<[u8]>) -> Result<()>,

Safety Read more
Source§

unsafe fn free_buf(&self, ptr: NonNull<[u8]>, layout: Layout)

Safety Read more
Source§

impl Clone for PoolAlloc

Source§

fn clone(&self) -> PoolAlloc

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl GlobalAlloc for PoolAlloc

Source§

unsafe fn alloc(&self, layout: Layout) -> *mut u8

Allocates memory as described by the given layout. Read more
Source§

unsafe fn dealloc(&self, ptr: *mut u8, _layout: Layout)

Deallocates the block of memory at the given ptr pointer with the given layout. Read more
1.28.0 · Source§

unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8

Behaves like alloc, but also ensures that the contents are set to zero before being returned. Read more
1.28.0 · Source§

unsafe fn realloc( &self, ptr: *mut u8, layout: Layout, new_size: usize, ) -> *mut u8

Shrinks or grows a block of memory to the given new_size in bytes. The block is described by the given ptr pointer and layout. Read more
Source§

impl Ord for PoolAlloc

Source§

fn cmp(&self, other: &PoolAlloc) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for PoolAlloc

Source§

fn eq(&self, other: &PoolAlloc) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for PoolAlloc

Source§

fn partial_cmp(&self, other: &PoolAlloc) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for PoolAlloc

Source§

impl Eq for PoolAlloc

Source§

impl Pool for PoolAlloc

Source§

impl Send for PoolAlloc

Source§

impl StructuralPartialEq for PoolAlloc

Source§

impl Sync for PoolAlloc

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A> GenericAlloc for A
where A: Allocator + ?Sized,

Source§

unsafe fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, Error>

Safety Read more
Source§

unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)

Safety Read more
Source§

unsafe fn init<T>(&self, val: T) -> Result<NonNull<T>, Error>

Safety Read more
Source§

unsafe fn alloc_then<T, F>(&self, f: F) -> Result<NonNull<T>, Error>
where F: FnOnce() -> Result<T, Error>,

Safety Read more
Source§

unsafe fn init_slice<T>( &self, len: usize, val: T, ) -> Result<NonNull<[T]>, Error>
where T: Clone,

Safety Read more
Source§

unsafe fn alloc_slice_then<T, F>( &self, len: usize, f: F, ) -> Result<NonNull<[T]>, Error>
where F: FnMut(usize) -> Result<T, Error>,

Safety Read more
Source§

unsafe fn zeroed<T>(&self) -> Result<NonNull<MaybeUninit<T>>, Error>

Safety Read more
Source§

unsafe fn zeroed_slice<T>( &self, len: usize, ) -> Result<NonNull<[MaybeUninit<T>]>, Error>

Safety Read more
Source§

unsafe fn uninit<T>(&self) -> Result<NonNull<MaybeUninit<T>>, Error>

Safety Read more
Source§

unsafe fn uninit_slice<T>( &self, len: usize, ) -> Result<NonNull<[MaybeUninit<T>]>, Error>

Safety Read more
Source§

unsafe fn release<T>(&self, ptr: NonNull<T>)

Safety Read more
Source§

unsafe fn release_with<T>(&self, ptr: NonNull<T>, layout: Layout)
where T: ?Sized,

Safety Read more
Source§

unsafe fn release_slice<T>(&self, ptr: NonNull<[T]>)

Safety Read more
Source§

unsafe fn release_slice_with<T>(&self, ptr: NonNull<[T]>, layout: Layout)

Safety Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.