Interface

Trait Interface 

Source
pub trait Interface {
    // Required methods
    unsafe fn make_native(&self) -> *mut CInterface;
    unsafe fn free_native(cpu: *mut CInterface)
       where Self: Sized;

    // Provided method
    fn type_id(&self) -> TypeId
       where Self: 'static { ... }
}

Required Methods§

Source

unsafe fn make_native(&self) -> *mut CInterface

Return a C-compatible spa_interface pointer

§Safety

The caller must manually free the returned pointer using free_native().

Source

unsafe fn free_native(cpu: *mut CInterface)
where Self: Sized,

Return a C-compatible spa_interface pointer

§Safety

The pointer must have been allocated using make_native().

Provided Methods§

Source

fn type_id(&self) -> TypeId
where Self: 'static,

Implementations§

Source§

impl dyn Interface

Source

pub fn is<T>(&self) -> bool
where T: 'static,

Source

pub fn downcast_box<T>(self: Box<Self>) -> Result<Box<T>, Box<Self>>
where T: 'static,

Source

pub fn downcast_arc_pin_box<T>( self: Arc<Pin<Box<Self>>>, ) -> Result<Arc<Pin<Box<T>>>, Arc<Pin<Box<Self>>>>
where T: 'static,

Trait Implementations§

Source§

impl Debug for dyn Interface

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§