pub trait ObjectSubclassExt: ObjectSubclass {
    // Required methods
    fn instance(&self) -> Self::Type;
    fn from_instance(obj: &Self::Type) -> &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§

source

fn instance(&self) -> Self::Type

Returns the corresponding object instance.

source

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

Returns the implementation from an instance.

source

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.

Implementors§