[][src]Struct thin::Box

pub struct Box<T: ?Sized + Thinnable> { /* fields omitted */ }

Implementations

impl<T: ?Sized + Thinnable> ThinBox<T>[src]

pub unsafe fn from_thin(thin: NonNull<Erased>) -> Self[src]

Construct an owned thin pointer from a raw thin pointer.

Safety

This pointer must logically own a valid instance of Self.

pub fn into_thin(this: Self) -> NonNull<Erased>[src]

Convert this owned thin pointer into a raw thin pointer.

To avoid a memory leak the pointer must be converted back using Self::from_raw.

pub unsafe fn from_fat(fat: NonNull<T>) -> Self[src]

Construct an owned thin pointer from a raw fat pointer.

Safety

This pointer must logically own a valid instance of Self.

pub fn into_fat(this: Self) -> Box<T>[src]

Convert this owned thin pointer into an owned fat pointer.

This is the std type that this type pretends to be. You can convert freely between the two representations with this function and Self::from(fat).

impl<T: ?Sized + Thinnable> ThinBox<T>[src]

pub fn new(
    slice: Vec<T::SliceItem>,
    head: impl FnOnce(&[T::SliceItem]) -> T::Head
) -> Self
[src]

Trait Implementations

impl<T: ?Sized + Thinnable> Clone for ThinBox<T> where
    Box<T>: Clone
[src]

impl<T: ?Sized> Debug for ThinBox<T> where
    T: Debug,
    T: Thinnable
[src]

impl<T: ?Sized + Thinnable> Deref for ThinBox<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T: ?Sized + Thinnable> DerefMut for ThinBox<T>[src]

impl<T: ?Sized> Display for ThinBox<T> where
    T: Display,
    T: Thinnable
[src]

impl<T: ?Sized + Thinnable> Drop for ThinBox<T>[src]

impl<T: ?Sized + Thinnable> From<Box<T>> for ThinBox<T>[src]

impl<T> From<Vec<T>> for Box<ThinSlice<T>>[src]

impl<T: ?Sized, O: ?Sized> PartialEq<O> for ThinBox<T> where
    T: PartialEq<O>,
    T: Thinnable
[src]

impl<T: ?Sized, O: ?Sized> PartialOrd<O> for ThinBox<T> where
    T: PartialOrd<O>,
    T: Thinnable
[src]

impl<T: ?Sized + Thinnable> Send for ThinBox<T> where
    T: Send
[src]

impl<T: ?Sized + Thinnable> Sync for ThinBox<T> where
    T: Sync
[src]

Auto Trait Implementations

impl<T: ?Sized> Unpin for ThinBox<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.