Trait ICapeInterfaceImpl

Source
pub trait ICapeInterfaceImpl: Display {
    type T: ICapeInterfaceImpl;

    const CAPEINTERFACE_VTABLE: ICapeInterface_VTable = _;

    // Required methods
    fn get_object_data(&mut self) -> &mut CapeObjectData;
    fn get_self(&mut self) -> *mut Self::T;

    // Provided methods
    fn init(&mut self) -> *mut ICapeInterface { ... }
    fn create_object_data<Timpl: ICapeInterfaceImpl>() -> CapeObjectData { ... }
    extern "C" fn raw_add_reference(me: *mut c_void) { ... }
    extern "C" fn raw_release(me: *mut c_void) { ... }
    extern "C" fn raw_query_interface(
        me: *mut c_void,
        uuid: *const CapeUUID,
        interface: *mut *mut ICapeInterface,
    ) -> CapeResult { ... }
    extern "C" fn raw_get_last_error(
        me: *mut c_void,
        error: *mut *mut ICapeError,
    ) -> CapeResult { ... }
    fn add_interface(
        &mut self,
        uuid: *const CapeUUID,
        interface: *mut ICapeInterface,
    ) { ... }
    fn set_last_error(&mut self, error: COBIAError, scope: &str) -> CapeResult { ... }
    fn clear_last_error(&mut self) { ... }
    fn as_icapeinterface(&mut self) -> *mut ICapeInterface { ... }
}
Expand description

This trait is implemented by all CAPE-OPEN objects.

It is not typically needed to implement this trait directly, but rather to use the cape_object_implementation macro that generates this trait.

Provided Associated Constants§

Source

const CAPEINTERFACE_VTABLE: ICapeInterface_VTable = _

the V-table for the ICapeInterface implementation.

Required Associated Types§

Required Methods§

Source

fn get_object_data(&mut self) -> &mut CapeObjectData

Returns a mutable reference to the internal CapeObjectData structure.

Source

fn get_self(&mut self) -> *mut Self::T

Returns a pointer to the implementing object.

Provided Methods§

Source

fn init(&mut self) -> *mut ICapeInterface

Initializes the object, setting up the interface pointer and adding it to the interface map.

Source

fn create_object_data<Timpl: ICapeInterfaceImpl>() -> CapeObjectData

Utility function for internal object setup

Source

extern "C" fn raw_add_reference(me: *mut c_void)

Source

extern "C" fn raw_release(me: *mut c_void)

Source

extern "C" fn raw_query_interface( me: *mut c_void, uuid: *const CapeUUID, interface: *mut *mut ICapeInterface, ) -> CapeResult

Source

extern "C" fn raw_get_last_error( me: *mut c_void, error: *mut *mut ICapeError, ) -> CapeResult

Source

fn add_interface( &mut self, uuid: *const CapeUUID, interface: *mut ICapeInterface, )

Utility function to add an interface to the interface map.

§Arguments
  • uuid - A pointer to the UUID of the interface.
  • interface - A pointer to the ICapeInterface implementation of the interface.
Source

fn set_last_error(&mut self, error: COBIAError, scope: &str) -> CapeResult

Utility function to set the last error and scope.

§Arguments
  • error - The error to set.
  • scope - The scope of the error, typically a string describing where the error occurred.
Source

fn clear_last_error(&mut self)

Utility function to clear the last error and scope.

Source

fn as_icapeinterface(&mut self) -> *mut ICapeInterface

Returns a unique pointer to the ICapeInterface implementation of the object.

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§