glib::wrapper! { #[doc(alias = "GInitiallyUnowned")] pub struct InitiallyUnowned(Object); match fn { type_ => || glib::gobject_ffi::g_initially_unowned_get_type(), } } pub trait InitiallyUnownedImpl: glib::subclass::prelude::ObjectImpl + glib::subclass::prelude::ObjectSubclass> { } unsafe impl glib::subclass::prelude::IsSubclassable for InitiallyUnowned { } mod imp_object { use glib::subclass::prelude::*; #[derive(Default)] pub struct TestObject { s: String, } #[glib::object_subclass] impl ObjectSubclass for TestObject { const NAME: &'static str = "TestObject"; type Type = super::TestObject; type ParentType = super::InitiallyUnowned; } impl ObjectImpl for TestObject {} impl super::InitiallyUnownedImpl for TestObject {} } glib::wrapper! { pub struct TestObject(ObjectSubclass) @extends InitiallyUnowned; } impl Default for TestObject { fn default() -> Self { glib::Object::new() } } fn main() { fn check(_obj: &T) {} let obj = TestObject::default(); check(&obj); }