Struct CapeTypeLibraries

Source
pub struct CapeTypeLibraries {
    pub(crate) interface: *mut ICapeLibraryEnumerator,
}
Expand description

Enumerator for all registered type libraries.

This is used to get the details of each library by name or UUID, or to get all libraries.

Fields§

§interface: *mut ICapeLibraryEnumerator

Implementations§

Source§

impl CapeTypeLibraries

Source

pub fn new() -> Result<CapeTypeLibraries, COBIAError>

Create a new library enumerator.

§Examples
use cobia;
use cobia::prelude::*;
cobia::cape_open_initialize().unwrap();
let library_enumerator = cobia::CapeTypeLibraries::new().unwrap();
//...
cobia::cape_open_cleanup();
Source

pub fn get_library_by_library_id( &self, library_id: &CapeUUID, ) -> Result<CapeLibraryDetails, COBIAError>

Get the library details by library UUID.

Get the details of a library by its UUID.

§Examples
use cobia;
use cobia::prelude::*;
use cobia::cape_open_1_2;
cobia::cape_open_initialize().unwrap();
let library_enumerator = cobia::CapeTypeLibraries::new().unwrap();
let library_details = library_enumerator.get_library_by_library_id(&cape_open_1_2::LIBRARY_ID).unwrap();
assert_eq!(library_details.get_name().unwrap(),"CAPEOPEN_1_2");
cobia::cape_open_cleanup();
Source

pub fn get_library_by_name( &self, lib_name: &str, ) -> Result<CapeLibraryDetails, COBIAError>

Get the library details by library name.

Get the details of a library by its name.

§Examples
use cobia;
use cobia::prelude::*;
use cobia::cape_open_1_2;
cobia::cape_open_initialize().unwrap();
let library_enumerator = cobia::CapeTypeLibraries::new().unwrap();
let library_details = library_enumerator.get_library_by_name("CAPEOPEN_1_2").unwrap();
assert_eq!(library_details.get_name().unwrap(),"CAPEOPEN_1_2");
cobia::cape_open_cleanup();
Source

pub fn get_library_by_interface_id( &self, interface_id: &CapeUUID, ) -> Result<CapeLibraryDetails, COBIAError>

Get the library details by interface id.

Get the details of a library the interface id of any contained interface.

§Examples
use cobia;
use cobia::prelude::*;
use cobia::cape_open_1_2;
cobia::cape_open_initialize().unwrap();
let library_enumerator = cobia::CapeTypeLibraries::new().unwrap();
let library_details = library_enumerator.get_library_by_interface_id(&cape_open_1_2::ICAPEIDENTIFICATION_UUID).unwrap();
assert_eq!(library_details.get_name().unwrap(),"CAPEOPEN_1_2");
cobia::cape_open_cleanup();
Source

pub fn libraries( &self, ) -> Result<CobiaCollection<CapeLibraryDetails>, COBIAError>

Get all type libraries.

Get a collection of all registered type libraries.

§Examples
use cobia;
use cobia::prelude::*;
cobia::cape_open_initialize().unwrap();
let library_enumerator = cobia::CapeTypeLibraries::new().unwrap();
let libraries = library_enumerator.libraries().unwrap();
assert!(libraries.size() > 0); //normally the CAPE-OPEN type libraries are registered
cobia::cape_open_cleanup();

Trait Implementations§

Source§

impl Clone for CapeTypeLibraries

Add pointer reference

ICapeTypeLibraries 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 CapeTypeLibraries

Release pointer

ICapeTypeLibraries 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.