[−][src]Struct alloc_compose::Segregate
Dispatches calls to AllocRef
between two allocators depending on the size allocated.
All allocations smaller than or equal to threshold
will be dispatched to Small
. The others
will go to Large
.
Fields
small: Small
large: Large
Trait Implementations
impl<Small, Large, const THRESHOLD: usize> AllocAll for Segregate<Small, Large, THRESHOLD> where
Small: AllocAll,
Large: AllocAll,
[src]
Small: AllocAll,
Large: AllocAll,
fn alloc_all(&mut self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr>
[src]
fn alloc_all_zeroed(
&mut self,
layout: Layout
) -> Result<NonNull<[u8]>, AllocErr>
[src]
&mut self,
layout: Layout
) -> Result<NonNull<[u8]>, AllocErr>
fn dealloc_all(&mut self)
[src]
Deallocates all the memory the allocator had allocated.
fn capacity(&self) -> usize
[src]
Returns the total capacity available in this allocator.
fn capacity_left(&self) -> usize
[src]
Returns the free capacity left for allocating.
fn is_empty(&self) -> bool
[src]
fn is_full(&self) -> bool
[src]
impl<Small, Large, const THRESHOLD: usize> AllocRef for Segregate<Small, Large, THRESHOLD> where
Small: AllocRef,
Large: AllocRef,
[src]
Small: AllocRef,
Large: AllocRef,
fn alloc(&mut self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr>
[src]
fn alloc_zeroed(&mut self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr>
[src]
unsafe fn dealloc(&mut self, ptr: NonNull<u8>, layout: Layout)
[src]
unsafe fn grow(
&mut self,
ptr: NonNull<u8>,
layout: Layout,
new_size: usize
) -> Result<NonNull<[u8]>, AllocErr>
[src]
&mut self,
ptr: NonNull<u8>,
layout: Layout,
new_size: usize
) -> Result<NonNull<[u8]>, AllocErr>
unsafe fn grow_zeroed(
&mut self,
ptr: NonNull<u8>,
layout: Layout,
new_size: usize
) -> Result<NonNull<[u8]>, AllocErr>
[src]
&mut self,
ptr: NonNull<u8>,
layout: Layout,
new_size: usize
) -> Result<NonNull<[u8]>, AllocErr>
unsafe fn shrink(
&mut self,
ptr: NonNull<u8>,
layout: Layout,
new_size: usize
) -> Result<NonNull<[u8]>, AllocErr>
[src]
&mut self,
ptr: NonNull<u8>,
layout: Layout,
new_size: usize
) -> Result<NonNull<[u8]>, AllocErr>
fn by_ref(&mut self) -> &mut Self
[src]
impl<Small: Clone, Large: Clone, const THRESHOLD: usize> Clone for Segregate<Small, Large, THRESHOLD>
[src]
fn clone(&self) -> Segregate<Small, Large, THRESHOLD>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Small: Copy, Large: Copy, const THRESHOLD: usize> Copy for Segregate<Small, Large, THRESHOLD>
[src]
impl<Small: Debug, Large: Debug, const THRESHOLD: usize> Debug for Segregate<Small, Large, THRESHOLD>
[src]
impl<Small, Large, const THRESHOLD: usize> Owns for Segregate<Small, Large, THRESHOLD> where
Small: Owns,
Large: Owns,
[src]
Small: Owns,
Large: Owns,
Auto Trait Implementations
impl<Small, Large, const THRESHOLD: usize> Send for Segregate<Small, Large, THRESHOLD> where
Large: Send,
Small: Send,
Large: Send,
Small: Send,
impl<Small, Large, const THRESHOLD: usize> Sync for Segregate<Small, Large, THRESHOLD> where
Large: Sync,
Small: Sync,
Large: Sync,
Small: Sync,
impl<Small, Large, const THRESHOLD: usize> Unpin for Segregate<Small, Large, THRESHOLD> where
Large: Unpin,
Small: Unpin,
Large: Unpin,
Small: Unpin,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,