#[repr(C)]pub enum ValueVTable {
Sized(ValueVTableSized),
Unsized(ValueVTableUnsized),
}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 for sized (ValueVTableSized)
and unsized (ValueVTableUnsized) shapes, allowing generic type-agnostic
dynamic dispatch for core capabilities (clone, drop, compare, hash, etc).
Variants§
Sized(ValueVTableSized)
VTable for operations on sized types.
Unsized(ValueVTableUnsized)
VTable for operations on unsized types.
Implementations§
Source§impl ValueVTable
impl ValueVTable
Sourcepub const fn sized(&self) -> Option<&ValueVTableSized>
pub const fn sized(&self) -> Option<&ValueVTableSized>
Returns a reference to the ValueVTableSized if this vtable is for a sized type.
§Returns
Some(&ValueVTableSized)if the type is sized.Noneif the type is unsized.
Sourcepub const fn sized_mut(&mut self) -> Option<&mut ValueVTableSized>
pub const fn sized_mut(&mut self) -> Option<&mut ValueVTableSized>
Returns a mutable reference to the ValueVTableSized if this vtable is for a sized type.
§Returns
Some(&mut ValueVTableSized)if the type is sized.Noneif the type is unsized.
Sourcepub const fn unsized(&self) -> Option<&ValueVTableUnsized>
pub const fn unsized(&self) -> Option<&ValueVTableUnsized>
Returns a reference to the ValueVTableUnsized if this vtable is for an unsized type.
§Returns
Some(&ValueVTableUnsized)if the type is unsized.Noneif the type is sized.
Sourcepub fn marker_traits(&self) -> MarkerTraits
pub 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 fn is_unwind_safe(&self) -> bool
pub fn is_unwind_safe(&self) -> bool
Check if the type implements the UnwindSafe marker trait
Sourcepub fn is_ref_unwind_safe(&self) -> bool
pub fn is_ref_unwind_safe(&self) -> bool
Check if the type implements the RefUnwindSafe marker trait
Sourcepub fn has_display(&self) -> bool
pub fn has_display(&self) -> bool
Returns true if the type implements the Display trait and the display function is available in the vtable.
Sourcepub fn has_debug(&self) -> bool
pub fn has_debug(&self) -> bool
Returns true if the type implements the Debug trait and the debug function is available in the vtable.
Sourcepub fn has_partial_eq(&self) -> bool
pub 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 fn has_partial_ord(&self) -> bool
pub 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 fn has_ord(&self) -> bool
pub fn has_ord(&self) -> bool
Returns true if the type implements the Ord trait and the ord function is available in the vtable.
Sourcepub fn has_hash(&self) -> bool
pub fn has_hash(&self) -> bool
Returns true if the type implements the Hash trait and the hash function is available in the vtable.
Sourcepub fn has_default_in_place(&self) -> bool
pub fn has_default_in_place(&self) -> bool
Returns true if the type supports default-in-place construction via the vtable.
Sourcepub fn has_clone_into(&self) -> bool
pub fn has_clone_into(&self) -> bool
Returns true if the type supports in-place cloning via the vtable.
Sourcepub fn has_parse(&self) -> bool
pub fn has_parse(&self) -> bool
Returns true if the type supports parsing from a string via the vtable.
Sourcepub const fn builder<T>() -> ValueVTableBuilder<T>
pub const fn builder<T>() -> ValueVTableBuilder<T>
Creates a new ValueVTableBuilder
Sourcepub const fn builder_unsized<T: ?Sized>() -> ValueVTableBuilderUnsized<T>
pub const fn builder_unsized<T: ?Sized>() -> ValueVTableBuilderUnsized<T>
Creates a new ValueVTableBuilderUnsized
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