[][src]Trait gstreamer::prelude::IsClassFor

pub unsafe trait IsClassFor: 'static {
    type Instance: ObjectType;
    fn get_type(&self) -> Type { ... }
fn upcast_ref<U>(&self) -> &U
    where
        U: IsClassFor,
        Self::Instance: IsA<<U as IsClassFor>::Instance>,
        <U as IsClassFor>::Instance: ObjectType
, { ... }
fn upcast_ref_mut<U>(&mut self) -> &mut U
    where
        U: IsClassFor,
        Self::Instance: IsA<<U as IsClassFor>::Instance>,
        <U as IsClassFor>::Instance: ObjectType
, { ... }
fn downcast_ref<U>(&self) -> Option<&U>
    where
        U: IsClassFor,
        <U as IsClassFor>::Instance: IsA<Self::Instance>,
        Self::Instance: ObjectType
, { ... }
fn downcast_ref_mut<U>(&mut self) -> Option<&mut U>
    where
        U: IsClassFor,
        <U as IsClassFor>::Instance: IsA<Self::Instance>,
        Self::Instance: ObjectType
, { ... }
fn from_type(type_: Type) -> Option<ClassRef<Self>> { ... } }

Trait for mapping a class struct type to its corresponding instance type.

Associated Types

type Instance: ObjectType

Corresponding Rust instance type for this class.

Loading content...

Provided methods

fn get_type(&self) -> Type

Get the type id for this class.

fn upcast_ref<U>(&self) -> &U where
    U: IsClassFor,
    Self::Instance: IsA<<U as IsClassFor>::Instance>,
    <U as IsClassFor>::Instance: ObjectType

Casts this class to a reference to a parent type's class.

fn upcast_ref_mut<U>(&mut self) -> &mut U where
    U: IsClassFor,
    Self::Instance: IsA<<U as IsClassFor>::Instance>,
    <U as IsClassFor>::Instance: ObjectType

Casts this class to a mutable reference to a parent type's class.

fn downcast_ref<U>(&self) -> Option<&U> where
    U: IsClassFor,
    <U as IsClassFor>::Instance: IsA<Self::Instance>,
    Self::Instance: ObjectType

Casts this class to a reference to a child type's class or fails if this class is not implementing the child class.

fn downcast_ref_mut<U>(&mut self) -> Option<&mut U> where
    U: IsClassFor,
    <U as IsClassFor>::Instance: IsA<Self::Instance>,
    Self::Instance: ObjectType

Casts this class to a mutable reference to a child type's class or fails if this class is not implementing the child class.

fn from_type(type_: Type) -> Option<ClassRef<Self>>

Gets the class struct corresponding to type_.

This will return None if type_ is not a subclass of Self.

Loading content...

Implementations on Foreign Types

impl IsClassFor for ObjectClass[src]

type Instance = Object

impl IsClassFor for InitiallyUnownedClass[src]

type Instance = InitiallyUnowned

impl IsClassFor for BindingClass[src]

type Instance = Binding

Loading content...

Implementors

impl IsClassFor for AllocatorClass

impl IsClassFor for BinClass

type Instance = Bin

impl IsClassFor for BufferPoolClass

impl IsClassFor for BusClass

type Instance = Bus

impl IsClassFor for ClockClass

impl IsClassFor for DeviceClass

impl IsClassFor for DeviceMonitorClass

impl IsClassFor for DeviceProviderClass

impl IsClassFor for DeviceProviderFactoryClass

impl IsClassFor for ElementClass

impl IsClassFor for ElementFactoryClass

impl IsClassFor for GhostPadClass

impl IsClassFor for gstreamer::ObjectClass

impl IsClassFor for PadClass

type Instance = Pad

impl IsClassFor for PadTemplateClass

impl IsClassFor for PipelineClass

impl IsClassFor for PluginClass

impl IsClassFor for PluginFeatureClass

impl IsClassFor for ProxyPadClass

impl IsClassFor for RegistryClass

impl IsClassFor for StreamClass

impl IsClassFor for StreamCollectionClass

impl IsClassFor for SystemClockClass

impl IsClassFor for TypeFindFactoryClass

Loading content...