use core::ptr::NonNull;
use super::{Alloc, AllocError};
pub unsafe trait GlobalAllocator
where
Self: Allocator,
{
fn __do_not_implement();
#[doc(hidden)]
fn new() -> Self;
fn clone_alloc<T>(alloc: &Self::Alloc<T>) -> Self::Alloc<T>;
#[doc(hidden)]
fn slice_from_raw_parts<T>(ptr: NonNull<T>, len: usize) -> Self::Alloc<T>;
}
pub unsafe trait Allocator
where
Self: Copy,
{
fn __do_not_implement();
#[doc(hidden)]
const IS_GLOBAL: bool;
#[doc(hidden)]
type Alloc<T>: Alloc<T>;
#[doc(hidden)]
fn alloc_empty<T>(self) -> Self::Alloc<T>;
#[doc(hidden)]
fn alloc<T>(self, value: T) -> Result<Self::Alloc<T>, AllocError>;
}