Struct ThinBox
struct ThinBox<T: ?Sized> { ... }
ThinBox.
A thin pointer for heap allocation, regardless of T.
Examples
use ThinBox;
let five = new;
let thin_slice = new_unsize;
let size_of_ptr = const >;
assert_eq!;
assert_eq!;
Implementations
impl<Dyn: ?Sized> ThinBox<Dyn>
fn new_unsize<T>(value: T) -> Self where T: Unsize<Dyn>Moves a type to the heap with its
Metadatastored in the heap allocation instead of on the stack.Examples
use ThinBox; let thin_slice = new_unsize;
impl<T> ThinBox<T>
fn new(value: T) -> SelfMoves a type to the heap with its
Metadatastored in the heap allocation instead of on the stack.Examples
use ThinBox; let five = new;fn try_new(value: T) -> Result<Self, AllocError>Moves a type to the heap with its
Metadatastored in the heap allocation instead of on the stack. Returns an error if allocation fails, instead of aborting.Examples
use ThinBox; let five = try_new?; # Ok::
impl<P, T> Receiver for ThinBox<T>
impl<T> Any for ThinBox<T>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for ThinBox<T>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for ThinBox<T>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> Freeze for ThinBox<T>
impl<T> From for ThinBox<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> RefUnwindSafe for ThinBox<T>
impl<T> ToString for ThinBox<T>
fn to_string(self: &Self) -> String
impl<T> Unpin for ThinBox<T>
impl<T> UnsafeUnpin for ThinBox<T>
impl<T> UnwindSafe for ThinBox<T>
impl<T, U> Into for ThinBox<T>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for ThinBox<T>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for ThinBox<T>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T: ?Sized + Debug> Debug for ThinBox<T>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T: ?Sized + Display> Display for ThinBox<T>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T: ?Sized + Error> Error for ThinBox<T>
fn source(self: &Self) -> Option<&dyn Error + 'static>
impl<T: ?Sized + Send> Send for ThinBox<T>
impl<T: ?Sized + Sync> Sync for ThinBox<T>
impl<T: ?Sized> Deref for ThinBox<T>
fn deref(self: &Self) -> &T
impl<T: ?Sized> DerefMut for ThinBox<T>
fn deref_mut(self: &mut Self) -> &mut T
impl<T: ?Sized> Drop for ThinBox<T>
fn drop(self: &mut Self)