Enum rustc_type_ir::sty::DynKind
source · pub enum DynKind {
Dyn,
DynStar,
}
Expand description
Specifies how a trait object is represented.
Variants
Dyn
An unsized dyn Trait
object
DynStar
A sized dyn* Trait
object
These objects are represented as a (data, vtable)
pair where data
is a ptr-sized value
(often a pointer to the real object, but not necessarily) and vtable
is a pointer to
the vtable for dyn* Trait
. The representation is essentially the same as &dyn Trait
or similar, but the drop function included in the vtable is responsible for freeing the
underlying storage if needed. This allows a dyn*
object to be treated agnostically with
respect to whether it points to a Box<T>
, Rc<T>
, etc.
Trait Implementations
sourceimpl<__CTX> HashStable<__CTX> for DynKindwhere
__CTX: HashStableContext,
impl<__CTX> HashStable<__CTX> for DynKindwhere
__CTX: HashStableContext,
fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)
sourceimpl Ord for DynKind
impl Ord for DynKind
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl PartialOrd<DynKind> for DynKind
impl PartialOrd<DynKind> for DynKind
sourcefn partial_cmp(&self, other: &DynKind) -> Option<Ordering>
fn partial_cmp(&self, other: &DynKind) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for DynKind
impl Eq for DynKind
impl StructuralEq for DynKind
impl StructuralPartialEq for DynKind
Auto Trait Implementations
impl RefUnwindSafe for DynKind
impl Send for DynKind
impl Sync for DynKind
impl Unpin for DynKind
impl UnwindSafe for DynKind
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T, R> InternIteratorElement<T, R> for T
impl<T, R> InternIteratorElement<T, R> for T
type Output = R
fn intern_with<I, F>(iter: I, f: F) -> <T as InternIteratorElement<T, R>>::Outputwhere
I: Iterator<Item = T>,
F: FnOnce(&[T]) -> R,
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
Dyn
: 0 bytesDynStar
: 0 bytes