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§
Sourceconst CAPEINTERFACE_VTABLE: ICapeInterface_VTable = _
const CAPEINTERFACE_VTABLE: ICapeInterface_VTable = _
the V-table for the ICapeInterface implementation.
Required Associated Types§
type T: ICapeInterfaceImpl
Required Methods§
Sourcefn get_object_data(&mut self) -> &mut CapeObjectData
fn get_object_data(&mut self) -> &mut CapeObjectData
Returns a mutable reference to the internal CapeObjectData structure.
Provided Methods§
Sourcefn init(&mut self) -> *mut ICapeInterface
fn init(&mut self) -> *mut ICapeInterface
Initializes the object, setting up the interface pointer and adding it to the interface map.
Sourcefn create_object_data<Timpl: ICapeInterfaceImpl>() -> CapeObjectData
fn create_object_data<Timpl: ICapeInterfaceImpl>() -> CapeObjectData
Utility function for internal object setup
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
Sourcefn add_interface(
&mut self,
uuid: *const CapeUUID,
interface: *mut ICapeInterface,
)
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.
Sourcefn set_last_error(&mut self, error: COBIAError, scope: &str) -> CapeResult
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.
Sourcefn clear_last_error(&mut self)
fn clear_last_error(&mut self)
Utility function to clear the last error and scope.
Sourcefn as_icapeinterface(&mut self) -> *mut ICapeInterface
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.