Struct hipool::NullAlloc

source ·
pub struct NullAlloc;

Trait Implementations§

source§

impl Allocator for NullAlloc

source§

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

Safety Read more
source§

unsafe fn deallocate(&self, _ptr: NonNull<[u8]>, _layout: Layout)

Safety Read more
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 alloc_then<T, F>(&self, f: F) -> Result<NonNull<T>, Error>
where F: FnOnce(&mut MaybeUninit<T>) -> Result<(), Error>,

Safety Read more
source§

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

Safety Read more
source§

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

Safety Read more
source§

unsafe fn init_slice<T: Clone>( &self, len: usize, val: T ) -> Result<NonNull<[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: ?Sized>(&self, ptr: NonNull<T>, layout: Layout)

Safety Read more
source§

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

Safety Read more
source§

impl Clone for NullAlloc

source§

fn clone(&self) -> NullAlloc

Returns a copy 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 NullAlloc

source§

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

Allocate memory as described by the given layout. Read more
source§

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

Deallocate 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

Shrink or grow 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 NullAlloc

source§

fn cmp(&self, other: &NullAlloc) -> 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 + PartialOrd,

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

impl PartialEq for NullAlloc

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for NullAlloc

source§

fn partial_cmp(&self, other: &NullAlloc) -> 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

This method 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

This method 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

This method 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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for NullAlloc

source§

impl Eq for NullAlloc

source§

impl StructuralEq for NullAlloc

source§

impl StructuralPartialEq for NullAlloc

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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>,

§

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>,

§

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.