Trait elrond_codec::TryStaticCast
source · pub trait TryStaticCast: Sized + 'static {
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.