pub struct ThinBox<T: ?Sized> {
ptr: WithOpaqueHeader,
_marker: PhantomData<T>,
}
🔬This is a nightly-only experimental API. (
thin_box
#92791)Expand description
Fields§
§ptr: WithOpaqueHeader
🔬This is a nightly-only experimental API. (
§thin_box
#92791)_marker: PhantomData<T>
🔬This is a nightly-only experimental API. (
thin_box
#92791)Implementations§
Source§impl<T> ThinBox<T>
impl<T> ThinBox<T>
Source§impl<Dyn: ?Sized> ThinBox<Dyn>
impl<Dyn: ?Sized> ThinBox<Dyn>
Sourcepub fn new_unsize<T>(value: T) -> Selfwhere
T: Unsize<Dyn>,
🔬This is a nightly-only experimental API. (thin_box
#92791)
pub fn new_unsize<T>(value: T) -> Selfwhere
T: Unsize<Dyn>,
thin_box
#92791)Source§impl<T: ?Sized> ThinBox<T>
impl<T: ?Sized> ThinBox<T>
fn meta(&self) -> <T as Pointee>::Metadata
🔬This is a nightly-only experimental API. (
thin_box
#92791)fn data(&self) -> *mut u8
🔬This is a nightly-only experimental API. (
thin_box
#92791)fn with_header(&self) -> &WithHeader<<T as Pointee>::Metadata>
🔬This is a nightly-only experimental API. (
thin_box
#92791)Trait Implementations§
Source§impl<T: ?Sized + Error> Error for ThinBox<T>
impl<T: ?Sized + Error> Error for ThinBox<T>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
Source§#[doc(hidden)] fn type_id(&self, _: Internal) -> TypeIdwhere
Self: 'static,
#[doc(hidden)] fn type_id(&self, _: Internal) -> TypeIdwhere
Self: 'static,
🔬This is a nightly-only experimental API. (
error_type_id
#60784)Gets the
TypeId
of self
.1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
impl<T: ?Sized + Send> Send for ThinBox<T>
ThinBox<T>
is Send
if T
is Send
because the data is owned.
impl<T: ?Sized + Sync> Sync for ThinBox<T>
ThinBox<T>
is Sync
if T
is Sync
because the data is owned.
Auto Trait Implementations§
impl<T> Freeze for ThinBox<T>where
T: ?Sized,
impl<T> RefUnwindSafe for ThinBox<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Unpin for ThinBox<T>
impl<T> UnwindSafe for ThinBox<T>where
T: UnwindSafe + ?Sized,
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
Source§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)] const IS_ZST: bool = _
#[doc(hidden)] const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const LAYOUT: Layout = _
#[doc(hidden)] const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const MAX_SLICE_LEN: usize = _
#[doc(hidden)] const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)The largest safe length for a
[Self]
. Read more