mz_sql::session::vars

Trait AsAny

Source
pub trait AsAny {
    // Required method
    fn as_any(&self) -> &dyn Any;
}
Expand description

Helper trait to cast a &dyn T to a &dyn Any.

In Rust all types that are 'static implement std::any::Any and thus can be casted to a &dyn Any. But once you create a trait object, the type is erased and thus so is the implementation for Any. This trait essentially adds a types’ Any impl to the vtable created when casted to trait object, if AsAny is a supertrait.

See Value for an example of using AsAny.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Implementors§

Source§

impl<T: Any> AsAny for T