[−][src]Struct thin::Box
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]
Trait Implementations
impl<T: ?Sized + Thinnable> Clone for ThinBox<T> where
Box<T>: Clone,
[src]
Box<T>: Clone,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: ?Sized> Debug for ThinBox<T> where
T: Debug,
T: Thinnable,
[src]
T: Debug,
T: Thinnable,
impl<T: ?Sized + Thinnable> Deref for ThinBox<T>
[src]
impl<T: ?Sized + Thinnable> DerefMut for ThinBox<T>
[src]
impl<T: ?Sized> Display for ThinBox<T> where
T: Display,
T: Thinnable,
[src]
T: Display,
T: Thinnable,
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]
T: PartialEq<O>,
T: Thinnable,
impl<T: ?Sized, O: ?Sized> PartialOrd<O> for ThinBox<T> where
T: PartialOrd<O>,
T: Thinnable,
[src]
T: PartialOrd<O>,
T: Thinnable,
fn partial_cmp(&self, other: &O) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: ?Sized + Thinnable> Send for ThinBox<T> where
T: Send,
[src]
T: Send,
impl<T: ?Sized + Thinnable> Sync for ThinBox<T> where
T: Sync,
[src]
T: Sync,
Auto Trait Implementations
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,