glib::object

Trait IsA

Source
pub unsafe trait IsA<T: ObjectType>:
    ObjectType
    + Into<T>
    + AsRef<T>
    + Borrow<T> { }
Expand description

Declares the “is a” relationship.

Self is said to implement T.

For instance, since originally GtkWidget is a subclass of GObject and implements the GtkBuildable interface, gtk::Widget implements IsA<glib::Object> and IsA<gtk::Buildable>.

The trait can only be implemented if the appropriate ToGlibPtr implementations exist.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§