Trait fusebox::subclass::prelude::ObjectSubclassExt

pub trait ObjectSubclassExt: ObjectSubclass {
    // Required methods
    fn obj(&self) -> BorrowedObject<'_, Self::Type>;
    fn from_obj(obj: &Self::Type) -> &Self;
    fn ref_counted(&self) -> ObjectImplRef<Self>;
    fn instance_data<U>(&self, type_: Type) -> Option<&U>
       where U: Any + Send + Sync + 'static;
}
Expand description

Extension methods for all ObjectSubclass impls.

Required Methods§

fn obj(&self) -> BorrowedObject<'_, Self::Type>

Returns the corresponding object instance.

Shorter alias for instance().

fn from_obj(obj: &Self::Type) -> &Self

Returns the implementation from an instance.

Shorter alias for from_instance().

fn ref_counted(&self) -> ObjectImplRef<Self>

Returns a new reference-counted wrapper around self.

fn instance_data<U>(&self, type_: Type) -> Option<&U>
where U: Any + Send + Sync + 'static,

Returns a pointer to the instance implementation specific data.

This is used for the subclassing infrastructure to store additional instance data.

Object Safety§

This trait is not object safe.

Implementors§

§

impl<T> ObjectSubclassExt for T
where T: ObjectSubclass,