glib::subclass::types

Function register_type

source
pub fn register_type<T: ObjectSubclass>() -> Type
Expand description

Register a glib::Type ID for T.

This must be called only once and will panic on a second call.

The object_subclass! macro will create a type_() function around this, which will ensure that it’s only ever called once.