[][src]Trait gio::subclass::prelude::InstanceStruct

pub unsafe trait InstanceStruct: 'static {
    type Type: ObjectSubclass;
    fn get_impl(&self) -> &Self::Type { ... }
fn get_class(&self) -> &<Self::Type as ObjectSubclass>::Class { ... } }

Trait implemented by structs that implement a GObject C instance struct.

The struct must be #[repr(C)] and have the parent type's instance struct as the first field.

See simple::InstanceStruct for a basic implementation of this that can be used most of the time and should only not be used if additional fields are required in the instance struct.

Associated Types

type Type: ObjectSubclass

Corresponding object subclass type for this instance struct.

Loading content...

Provided methods

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

Returns the implementation for from this instance struct, that is the implementor of ObjectImpl or subtraits.

fn get_class(&self) -> &<Self::Type as ObjectSubclass>::Class

Returns the class struct for this specific instance.

Loading content...

Implementations on Foreign Types

impl<T> InstanceStruct for InstanceStruct<T> where
    T: ObjectSubclass
[src]

type Type = T

Loading content...

Implementors

Loading content...