Struct sp_std::ptr::DynMetadata [−][src]
ptr_metadata
)The metadata for a Dyn = dyn SomeTrait
trait object type.
It is a pointer to a vtable (virtual call table) that represents all the necessary information to manipulate the concrete type stored inside a trait object. The vtable notably it contains:
- type size
- type alignment
- a pointer to the type’s
drop_in_place
impl (may be a no-op for plain-old-data) - pointers to all the methods for the type’s implementation of the trait
Note that the first three are special because they’re necessary to allocate, drop, and deallocate any trait object.
It is possible to name this struct with a type parameter that is not a dyn
trait object
(for example DynMetadata<u64>
) but not to obtain a meaningful value of that struct.
Implementations
impl<Dyn> DynMetadata<Dyn> where
Dyn: ?Sized,
[src]
Dyn: ?Sized,
pub fn size_of(self) -> usize
[src]
ptr_metadata
)Returns the size of the type associated with this vtable.
pub fn align_of(self) -> usize
[src]
ptr_metadata
)Returns the alignment of the type associated with this vtable.
pub fn layout(self) -> Layout
[src]
ptr_metadata
)Returns the size and alignment together as a Layout
Trait Implementations
impl<Dyn> Clone for DynMetadata<Dyn> where
Dyn: ?Sized,
[src]
Dyn: ?Sized,
pub fn clone(&self) -> DynMetadata<Dyn>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Dyn> Copy for DynMetadata<Dyn> where
Dyn: ?Sized,
[src]
Dyn: ?Sized,
impl<Dyn> Debug for DynMetadata<Dyn> where
Dyn: ?Sized,
[src]
Dyn: ?Sized,
impl<Dyn> Eq for DynMetadata<Dyn> where
Dyn: ?Sized,
[src]
Dyn: ?Sized,
impl<Dyn> Hash for DynMetadata<Dyn> where
Dyn: ?Sized,
[src]
Dyn: ?Sized,
pub fn hash<H>(&self, hasher: &mut H) where
H: Hasher,
[src]
H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<Dyn> Ord for DynMetadata<Dyn> where
Dyn: ?Sized,
[src]
Dyn: ?Sized,
pub fn cmp(&self, other: &DynMetadata<Dyn>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<Dyn> PartialEq<DynMetadata<Dyn>> for DynMetadata<Dyn> where
Dyn: ?Sized,
[src]
Dyn: ?Sized,
pub fn eq(&self, other: &DynMetadata<Dyn>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<Dyn> PartialOrd<DynMetadata<Dyn>> for DynMetadata<Dyn> where
Dyn: ?Sized,
[src]
Dyn: ?Sized,
pub fn partial_cmp(&self, other: &DynMetadata<Dyn>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<Dyn> Send for DynMetadata<Dyn> where
Dyn: ?Sized,
[src]
Dyn: ?Sized,
impl<Dyn> Sync for DynMetadata<Dyn> where
Dyn: ?Sized,
[src]
Dyn: ?Sized,
impl<Dyn> Unpin for DynMetadata<Dyn> where
Dyn: ?Sized,
[src]
Dyn: ?Sized,
Auto Trait Implementations
impl<Dyn: ?Sized> RefUnwindSafe for DynMetadata<Dyn> where
Dyn: RefUnwindSafe,
Dyn: RefUnwindSafe,
impl<Dyn: ?Sized> UnwindSafe for DynMetadata<Dyn> where
Dyn: UnwindSafe,
Dyn: UnwindSafe,
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,