pub struct SmallBox<T: ?Sized, Space, A: Allocator = Global>(/* private fields */);Implementations§
Source§impl<T: Sized, S, A: Allocator + Default> SmallBox<MaybeUninit<T>, S, A>
impl<T: Sized, S, A: Allocator + Default> SmallBox<MaybeUninit<T>, S, A>
pub fn try_new_uninit() -> Result<Self, AllocError>
pub fn new_uninit() -> Self
pub fn try_new_zeroed() -> Result<Self, AllocError>
pub fn new_zeroed() -> Self
Source§impl<T: Sized, S, A: Allocator> SmallBox<MaybeUninit<T>, S, A>
impl<T: Sized, S, A: Allocator> SmallBox<MaybeUninit<T>, S, A>
pub fn try_new_uninit_in(alloc: A) -> Result<Self, AllocError>
pub fn new_uninit_in(alloc: A) -> Self
pub fn try_new_zeroed_in(alloc: A) -> Result<Self, AllocError>
pub fn new_zeroed_in(alloc: A) -> Self
pub unsafe fn assume_init(self) -> SmallBox<T, S, A>
pub fn write(self, value: T) -> SmallBox<T, S, A>
Source§impl<T: Sized, S, A: Allocator + Default> SmallBox<[MaybeUninit<T>], S, A>
impl<T: Sized, S, A: Allocator + Default> SmallBox<[MaybeUninit<T>], S, A>
pub fn try_new_uninit_slice(len: usize) -> Result<Self, AllocError>
pub fn new_uninit_slice(len: usize) -> Self
pub fn try_new_zeroed_slice(len: usize) -> Result<Self, AllocError>
pub fn new_zeroed_slice(len: usize) -> Self
Source§impl<T: Sized, S, A: Allocator> SmallBox<[MaybeUninit<T>], S, A>
impl<T: Sized, S, A: Allocator> SmallBox<[MaybeUninit<T>], S, A>
pub fn try_new_uninit_slice_in(len: usize, alloc: A) -> Result<Self, AllocError>
pub fn new_uninit_slice_in(len: usize, alloc: A) -> Self
pub fn try_new_zeroed_slice_in(len: usize, alloc: A) -> Result<Self, AllocError>
pub fn new_zeroed_slice_in(len: usize, alloc: A) -> Self
pub unsafe fn assume_init(self) -> SmallBox<[T], S, A>
Source§impl<T: Sized, S, A: Allocator> SmallBox<T, S, A>
impl<T: Sized, S, A: Allocator> SmallBox<T, S, A>
pub const INLINED: bool
pub fn try_new_in(value: T, alloc: A) -> Result<Self, AllocError>
pub fn new_in(value: T, alloc: A) -> Self
pub fn into_inner(boxed: Self) -> T
pub fn uninit(boxed: Self) -> SmallBox<MaybeUninit<T>, S, A>
Source§impl<T: Sized, S, A: Allocator> SmallBox<[T], S, A>
impl<T: Sized, S, A: Allocator> SmallBox<[T], S, A>
pub fn uninit(boxed: Self) -> SmallBox<[MaybeUninit<T>], S, A>
Source§impl<T: ?Sized, S, A: Allocator + Default> SmallBox<T, S, A>where
Self: CloneFrom<T, A>,
impl<T: ?Sized, S, A: Allocator + Default> SmallBox<T, S, A>where
Self: CloneFrom<T, A>,
pub fn try_clone_from(data: &T) -> Result<Self, AllocError>
pub fn clone_from(data: &T) -> Self
Trait Implementations§
Source§impl<T: ?Sized, S, A: Allocator> BorrowMut<T> for SmallBox<T, S, A>
impl<T: ?Sized, S, A: Allocator> BorrowMut<T> for SmallBox<T, S, A>
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T: Sized + Clone, S, A: Allocator + Clone> Clone for SmallBox<[T], S, A>
Available on crate feature alloc and non-no_global_oom_handling only.
impl<T: Sized + Clone, S, A: Allocator + Clone> Clone for SmallBox<[T], S, A>
Available on crate feature
alloc and non-no_global_oom_handling only.Source§impl<T: Sized + Clone, S, A: Allocator + Clone> Clone for SmallBox<T, S, A>
Available on crate feature alloc and non-no_global_oom_handling only.
impl<T: Sized + Clone, S, A: Allocator + Clone> Clone for SmallBox<T, S, A>
Available on crate feature
alloc and non-no_global_oom_handling only.Source§impl<S, A: Allocator + Clone> Clone for SmallBox<str, S, A>
Available on crate feature alloc and non-no_global_oom_handling only.
impl<S, A: Allocator + Clone> Clone for SmallBox<str, S, A>
Available on crate feature
alloc and non-no_global_oom_handling only.Source§impl<T: Sized + Clone, S, A: Allocator> CloneFrom<[T], A> for SmallBox<[T], S, A>
impl<T: Sized + Clone, S, A: Allocator> CloneFrom<[T], A> for SmallBox<[T], S, A>
fn try_new_clone_from_in(data: &[T], alloc: A) -> Result<Self, AllocError>
fn new_clone_from_in(data: &T, alloc: A) -> Self
Source§impl<T: Sized + Clone, S, A: Allocator> CloneFrom<T, A> for SmallBox<T, S, A>
impl<T: Sized + Clone, S, A: Allocator> CloneFrom<T, A> for SmallBox<T, S, A>
fn try_new_clone_from_in(data: &T, alloc: A) -> Result<Self, AllocError>
fn new_clone_from_in(data: &T, alloc: A) -> Self
Source§impl<S, A: Allocator> CloneFrom<str, A> for SmallBox<str, S, A>
impl<S, A: Allocator> CloneFrom<str, A> for SmallBox<str, S, A>
fn try_new_clone_from_in(data: &str, alloc: A) -> Result<Self, AllocError>
fn new_clone_from_in(data: &T, alloc: A) -> Self
Source§impl<T: Sized + Copy, S, A: Allocator> CopyFrom<[T], A> for SmallBox<[T], S, A>
impl<T: Sized + Copy, S, A: Allocator> CopyFrom<[T], A> for SmallBox<[T], S, A>
fn try_new_copy_from_in(data: &[T], alloc: A) -> Result<Self, AllocError>
fn new_copy_from_in(data: &T, alloc: A) -> Self
Source§impl<T: Sized + Copy, S, A: Allocator> CopyFrom<T, A> for SmallBox<T, S, A>
impl<T: Sized + Copy, S, A: Allocator> CopyFrom<T, A> for SmallBox<T, S, A>
fn try_new_copy_from_in(data: &T, alloc: A) -> Result<Self, AllocError>
fn new_copy_from_in(data: &T, alloc: A) -> Self
Source§impl<S, A: Allocator> CopyFrom<str, A> for SmallBox<str, S, A>
impl<S, A: Allocator> CopyFrom<str, A> for SmallBox<str, S, A>
fn try_new_copy_from_in(data: &str, alloc: A) -> Result<Self, AllocError>
fn new_copy_from_in(data: &T, alloc: A) -> Self
Source§impl<T: Sized, S, A: Allocator + Default> Default for SmallBox<[T], S, A>
Available on crate feature alloc and non-no_global_oom_handling only.
impl<T: Sized, S, A: Allocator + Default> Default for SmallBox<[T], S, A>
Available on crate feature
alloc and non-no_global_oom_handling only.Source§impl<T: Sized + Default, S, A: Allocator + Default> Default for SmallBox<T, S, A>
Available on crate feature alloc and non-no_global_oom_handling only.
impl<T: Sized + Default, S, A: Allocator + Default> Default for SmallBox<T, S, A>
Available on crate feature
alloc and non-no_global_oom_handling only.Source§impl<S, A: Allocator + Default> Default for SmallBox<str, S, A>
Available on crate feature alloc and non-no_global_oom_handling only.
impl<S, A: Allocator + Default> Default for SmallBox<str, S, A>
Available on crate feature
alloc and non-no_global_oom_handling only.Source§impl<T: Sized, S, A: Allocator + Default> From<T> for SmallBox<T, S, A>
Available on crate feature alloc and non-no_global_oom_handling only.
impl<T: Sized, S, A: Allocator + Default> From<T> for SmallBox<T, S, A>
Available on crate feature
alloc and non-no_global_oom_handling only.Source§impl<T: ?Sized + Ord, S, A: Allocator> Ord for SmallBox<T, S, A>
impl<T: ?Sized + Ord, S, A: Allocator> Ord for SmallBox<T, S, A>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: ?Sized + PartialOrd, S, A: Allocator> PartialOrd for SmallBox<T, S, A>
impl<T: ?Sized + PartialOrd, S, A: Allocator> PartialOrd for SmallBox<T, S, A>
impl<T: ?Sized + Eq, S, A: Allocator> Eq for SmallBox<T, S, A>
Auto Trait Implementations§
impl<T, Space, A> Freeze for SmallBox<T, Space, A>
impl<T, Space, A> RefUnwindSafe for SmallBox<T, Space, A>where
<T as Pointee>::Metadata: RefUnwindSafe,
A: RefUnwindSafe,
T: RefUnwindSafe + ?Sized,
Space: RefUnwindSafe,
impl<T, Space, A> Send for SmallBox<T, Space, A>
impl<T, Space, A> Sync for SmallBox<T, Space, A>
impl<T, Space, A> Unpin for SmallBox<T, Space, A>
impl<T, Space, A> UnwindSafe for SmallBox<T, Space, A>where
<T as Pointee>::Metadata: UnwindSafe,
A: UnwindSafe,
T: UnwindSafe + ?Sized,
Space: UnwindSafe,
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