pub trait Castable: IDLInterface + DomObject + Sized {
    fn is<T>(&self) -> bool
        T: DerivedFrom<Self>
, { ... } fn upcast<T>(&self) -> &T
        T: Castable,
        Self: DerivedFrom<T>
, { ... } fn downcast<T>(&self) -> Option<&T>
        T: DerivedFrom<Self>
, { ... } }
Expand description

A trait to hold the cast functions of IDL interfaces that either derive or are derived from other interfaces.

Provided Methods

Check whether a DOM object implements one of its deriving interfaces.

Cast a DOM object upwards to one of the interfaces it derives from.

Cast a DOM object downwards to one of the interfaces it might implement.