Skip to main content

AnyValue

Trait AnyValue 

Source
pub trait AnyValue: AnyValueTypeless {
    // Required method
    fn value_typeid(&self) -> TypeId;

    // Provided methods
    fn downcast_ref<T: 'static>(&self) -> Option<&T> { ... }
    fn downcast<T: 'static>(self) -> Option<T>
       where Self: Sized { ... }
}
Expand description

Type erased value interface.

Know it’s type and size, possibly compile-time.

Required Methods§

Provided Methods§

Source

fn downcast_ref<T: 'static>(&self) -> Option<&T>

Source

fn downcast<T: 'static>(self) -> Option<T>
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl AnyValue for AnyValueRaw

Source§

impl<'a, AnyVecPtr: IAnyVecRawPtr> AnyValue for ElementPointer<'a, AnyVecPtr>

Source§

impl<'a, T: AnyValueCloneable + AnyValue> AnyValue for LazyClone<'a, T>

Source§

impl<Op: Operation> AnyValue for TempValue<Op>

Source§

impl<T: 'static> AnyValue for AnyValueWrapper<T>