pub trait TryStaticCast: Sized + 'static {
    // Provided methods
    fn type_eq<U: TryStaticCast>() -> bool { ... }
    fn try_cast<U: TryStaticCast>(self) -> Option<U> { ... }
    fn try_cast_ref<U: TryStaticCast>(&self) -> Option<&U> { ... }
}
Expand description

Use to transfer objects from one generic type to another, without the compiler being able to determine whether or not the two types are the same. The cast is statically dispatched.

Provided Methods§

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl TryStaticCast for i32

source§

impl TryStaticCast for ()

Implementors§