glib::object

Trait ObjectType

Source
pub unsafe trait ObjectType:
    UnsafeFrom<ObjectRef>
    + Into<ObjectRef>
    + StaticType
    + Debug
    + Clone
    + PartialEq
    + Eq
    + PartialOrd
    + Ord
    + Hash
    + ValueType
    + ToValue
    + ToValueOptional
    + FromValueOptional<'static>
    + for<'a> ToGlibPtr<'a, *mut Self::GlibType>
    + IntoGlibPtr<*mut Self::GlibType>
    + 'static {
    type GlibType: 'static;
    type GlibClassType: 'static;

    // Required methods
    fn as_object_ref(&self) -> &ObjectRef;
    fn as_ptr(&self) -> *mut Self::GlibType;
    unsafe fn from_glib_ptr_borrow(ptr: &*mut Self::GlibType) -> &Self;
}
Expand description

Implemented by types representing glib::Object and subclasses of it.

Required Associated Types§

Source

type GlibType: 'static

type of the FFI Instance structure.

Source

type GlibClassType: 'static

type of the FFI Class structure.

Required Methods§

Source

fn as_object_ref(&self) -> &ObjectRef

Source

fn as_ptr(&self) -> *mut Self::GlibType

Source

unsafe fn from_glib_ptr_borrow(ptr: &*mut Self::GlibType) -> &Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§