#[repr(C)]pub struct ValueVTable {Show 16 fields
pub type_name: TypeNameFn,
pub marker_traits: MarkerTraits,
pub drop_in_place: Option<DropInPlaceFn>,
pub invariants: Option<InvariantsFn>,
pub display: Option<DisplayFn>,
pub debug: Option<DebugFn>,
pub default_in_place: Option<DefaultInPlaceFn>,
pub clone_into: Option<CloneIntoFn>,
pub partial_eq: Option<PartialEqFn>,
pub partial_ord: Option<PartialOrdFn>,
pub ord: Option<CmpFn>,
pub hash: Option<HashFn>,
pub parse: Option<ParseFn>,
pub try_from: Option<TryFromFn>,
pub try_into_inner: Option<TryIntoInnerFn>,
pub try_borrow_inner: Option<TryBorrowInnerFn>,
}Expand description
A vtable representing the operations that can be performed on a type, either for sized or unsized types.
This enum encapsulates the specific vtables allowing generic type-agnostic dynamic dispatch for core capabilities (clone, drop, compare, hash, etc).
Fields§
§type_name: TypeNameFncf. TypeNameFn
marker_traits: MarkerTraitsMarker traits implemented by the type
drop_in_place: Option<DropInPlaceFn>cf. DropInPlaceFn — if None, drops without side-effects
invariants: Option<InvariantsFn>cf. InvariantsFn
display: Option<DisplayFn>cf. DisplayFn
debug: Option<DebugFn>cf. DebugFn
default_in_place: Option<DefaultInPlaceFn>cf. DefaultInPlaceFn
clone_into: Option<CloneIntoFn>cf. CloneIntoFn
partial_eq: Option<PartialEqFn>cf. PartialEqFn for equality comparison
partial_ord: Option<PartialOrdFn>cf. PartialOrdFn for partial ordering comparison
ord: Option<CmpFn>cf. CmpFn for total ordering
hash: Option<HashFn>cf. HashFn
parse: Option<ParseFn>cf. ParseFn
try_from: Option<TryFromFn>cf. TryFromFn
This also acts as a “TryFromInner” — you can use it to go:
String=>Utf8PathBufString=>UuidT=>Option<T>T=>Arc<T>T=>NonZero<T>- etc.
try_into_inner: Option<TryIntoInnerFn>cf. TryIntoInnerFn
This is used by transparent types to convert the wrapper type into its inner value. Primarily used during serialization.
try_borrow_inner: Option<TryBorrowInnerFn>cf. TryBorrowInnerFn
This is used by transparent types to efficiently access the inner value without copying.
Implementations§
Source§impl ValueVTable
impl ValueVTable
Sourcepub const fn marker_traits(&self) -> MarkerTraits
pub const fn marker_traits(&self) -> MarkerTraits
Get the marker traits implemented for the type
Sourcepub const fn type_name(&self) -> TypeNameFn
pub const fn type_name(&self) -> TypeNameFn
Get the type name fn of the type
Sourcepub const fn is_unwind_safe(&self) -> bool
pub const fn is_unwind_safe(&self) -> bool
Check if the type implements the UnwindSafe marker trait
Sourcepub const fn is_ref_unwind_safe(&self) -> bool
pub const fn is_ref_unwind_safe(&self) -> bool
Check if the type implements the RefUnwindSafe marker trait
Sourcepub const fn has_display(&self) -> bool
pub const fn has_display(&self) -> bool
Returns true if the type implements the Display trait and the display function is available in the vtable.
Sourcepub const fn has_debug(&self) -> bool
pub const fn has_debug(&self) -> bool
Returns true if the type implements the Debug trait and the debug function is available in the vtable.
Sourcepub const fn has_partial_eq(&self) -> bool
pub const fn has_partial_eq(&self) -> bool
Returns true if the type implements the PartialEq trait and the partial_eq function is available in the vtable.
Sourcepub const fn has_partial_ord(&self) -> bool
pub const fn has_partial_ord(&self) -> bool
Returns true if the type implements the PartialOrd trait and the partial_ord function is available in the vtable.
Sourcepub const fn has_ord(&self) -> bool
pub const fn has_ord(&self) -> bool
Returns true if the type implements the Ord trait and the ord function is available in the vtable.
Sourcepub const fn has_hash(&self) -> bool
pub const fn has_hash(&self) -> bool
Returns true if the type implements the Hash trait and the hash function is available in the vtable.
Sourcepub const fn has_default_in_place(&self) -> bool
pub const fn has_default_in_place(&self) -> bool
Returns true if the type supports default-in-place construction via the vtable.
Sourcepub const fn has_clone_into(&self) -> bool
pub const fn has_clone_into(&self) -> bool
Returns true if the type supports in-place cloning via the vtable.
Sourcepub const fn has_parse(&self) -> bool
pub const fn has_parse(&self) -> bool
Returns true if the type supports parsing from a string via the vtable.
Sourcepub const fn builder<T: ?Sized>() -> ValueVTableBuilder<T>
pub const fn builder<T: ?Sized>() -> ValueVTableBuilder<T>
Creates a new ValueVTableBuilder
Trait Implementations§
Source§impl Clone for ValueVTable
impl Clone for ValueVTable
Source§fn clone(&self) -> ValueVTable
fn clone(&self) -> ValueVTable
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more