Trait glib::object::Downcast
[−]
[src]
pub trait Downcast<T> { fn downcast(self) -> Result<T, Self>; fn downcast_unchecked(self) -> T; }
A complement to Upcast
that allows downcasting.
Required Methods
fn downcast(self) -> Result<T, Self>
Tries to downcast to T
.
Returns Ok(T)
if the instance implements T
and Err(Self)
otherwise.
fn downcast_unchecked(self) -> T
Downcasts to T
unconditionally.
Panics if the instance doesn't implement T
.