Struct CapeRegistrar

Source
pub struct CapeRegistrar {
    pub(crate) interface: *mut ICapePMCRegistrar,
}
Expand description

Rust wrapper for ICapePMCRegistrar interface

A CapeRegistrar object is passed to the registration_details function of the CapePMC trait implementation. It is used to register the component in the COBIA registry.

Fields§

§interface: *mut ICapePMCRegistrar

Pointer to the ICapePMCRegistrar interface

Implementations§

Source§

impl CapeRegistrar

Source

pub fn put_name(&self, name: &str) -> Result<(), COBIAError>

Put the (default) name of the component

§Arguments
  • name - The name of the component
§Returns
  • Result<(), COBIAError> - Ok if successful, Err if there was an error
Source

pub fn put_description(&self, description: &str) -> Result<(), COBIAError>

Put the (default) description of the component

§Arguments
  • description - The description of the component
§Returns
  • Result<(), COBIAError> - Ok if successful, Err if there was an error
Source

pub fn put_cape_version(&self, cape_version: &str) -> Result<(), COBIAError>

Put the CAPE-OPEN version of the component

§Arguments
  • cape_version - The CAPE-OPEN version of the component, e.g. “1.2”
§Returns
  • Result<(), COBIAError> - Ok if successful, Err if there was an error
Source

pub fn put_component_version( &self, component_version: &str, ) -> Result<(), COBIAError>

Put the component software version

§Arguments
  • component_version - The version of the component, e.g. “1.0.0”
§Returns
  • Result<(), COBIAError> - Ok if successful, Err if there was an error
Source

pub fn put_vendor_url(&self, vendor_url: &str) -> Result<(), COBIAError>

Put the vendor URL of the component

§Arguments
  • vendor_url - The URL of the vendor’s product website
§Returns
  • Result<(), COBIAError> - Ok if successful, Err if there was an error
Source

pub fn put_help_url(&self, help_url: &str) -> Result<(), COBIAError>

Put the help URL of the component

§Arguments
  • help_url - The URL of the component’s help documentation
§Returns
  • Result<(), COBIAError> - Ok if successful, Err if there was an error
Source

pub fn put_about(&self, about: &str) -> Result<(), COBIAError>

Put the about information of the component

§Arguments
  • about - The about information of the component, typically a short description
§Returns
  • Result<(), COBIAError> - Ok if successful, Err if there was an error
Source

pub fn put_uuid(&self, uuid: &CapeUUID) -> Result<(), COBIAError>

Put the UUID of the component

§Arguments
  • uuid - The UUID of the component, a unique identifier to identify the component
§Returns
  • Result<(), COBIAError> - Ok if successful, Err if there was an error
Source

pub fn put_prog_id(&self, prog_id: &str) -> Result<(), COBIAError>

Put the ProgID of the component

The ProgID is a programmatic human readable ID that is a placeholder for the component’s UUID.

The ProgID points to this specific version of the component. The version-independent ProgID is used to identify the component regardless of its version.

§Arguments
  • prog_id - The ProgID of the component, a string identifier used in COM
Source

pub fn put_version_independent_prog_id( &self, prog_id: &str, ) -> Result<(), COBIAError>

Put the version-independent ProgID of the component

The version-independent ProgID is used to identify the component regardless of its version. If a PME chooses to store this information, a subsequent software update of the component will cause the PME to update to the new version. s

§Arguments
  • prog_id - The version-independent ProgID of the component, a string identifier used in COM
§Returns
  • Result<(), COBIAError> - Ok if successful, Err if there was an error
Source

pub fn add_cat_id(&self, cat_id: &CapeUUID) -> Result<(), COBIAError>

Add a category ID to the component

Typically a PMC registers with at least one category ID to indicate the type of component it is, such as a unit operation, property set, or data type. Also at least one category ID should be added to identify which CAPE-OPEN version the component supports.

§Arguments
  • cat_id - The category ID to add, a unique identifier for the component’s category
§Returns
  • Result<(), COBIAError> - Ok if successful, Err if there was an error
Source

pub fn put_flags( &self, flags: CapePMCRegistrationFlags, ) -> Result<(), COBIAError>

Put the creation flags for the component

If the component has specific restrictions, such as being suitable only for the restricted threading model, this method can be used to set those flags.

§Arguments
  • flags - The flags to set, indicating the component’s creation restrictions
§Returns
  • Result<(), COBIAError> - Ok if successful, Err if there was an error
Source

pub fn add_location( &self, service_type: CapePMCServiceType, location: &str, ) -> Result<(), COBIAError>

Add a location for the component

Components can be registered for multiple service types, such as 32-bit and 64-bit versions for Windows. Eeach service type has its own location identifier, such as a DLL or shared object for an in-process implementation.

§Arguments
  • service_type - The service type for which the location is being registered
  • location - The location identifier, such as a DLL path
§Returns
  • Result<(), COBIAError> - Ok if successful, Err if there was an error
Source

pub fn commit(&self) -> Result<(), COBIAError>

Commit the registration of the component

After all the necessary information has been provided, this method is called to finalize registration.

§Returns
  • Result<(), COBIAError> - Ok if successful, Err if there was an error

Trait Implementations§

Source§

impl Clone for CapeRegistrar

Add pointer reference

ICapeRegistrar derives from ICobiaBase, which contains addReference() and release(). The Clone trait calls addReference.

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Drop for CapeRegistrar

Release pointer

ICapeRegistrar derives from ICobiaBase, which contains addReference() and release(). The Drop trait calls release.

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.