Trait glib::object::Downcast [] [src]

pub trait Downcast<T> {
    fn can_downcast(&self) -> bool;
fn downcast(self) -> Result<T, Self>
    where
        Self: Sized
;
unsafe fn downcast_unchecked(self) -> T; }

Downcasts support.

Required Methods

Checks if it's possible to downcast to T.

Returns true if the instance implements T and false otherwise.

Tries to downcast to T.

Returns Ok(T) if the instance implements T and Err(Self) otherwise.

Downcasts to T unconditionally.

Panics if compiled with debug_assertions and the instance doesn't implement T.

Implementors