Struct CapeRegistryKey

Source
pub struct CapeRegistryKey {
    pub(crate) interface: *mut ICapeRegistryKey,
}
Expand description

A class that provides access to a COBIA registry key in a read-only manner

This class provides access to a COBIA registry key in a read-only manner; for writing to the COBIA registry, consider using CapeRegistryKeyWriter.

§Example

use cobia;
use cobia::prelude::*;
cobia::cape_open_initialize().unwrap();
let lib_key=cobia::CapeRegistryKey::from_path("/types/libraries/{8d1d724f-ab15-48e5-80e4-a612468e68d4}").unwrap(); //points to the CAPE-OPEN 1.2 type library
assert_eq!(lib_key.get_string_value("name",None).unwrap(), "CAPEOPEN_1_2".to_string()); //check its name
cobia::cape_open_cleanup();

Fields§

§interface: *mut ICapeRegistryKey

Implementations§

Source§

impl CapeRegistryKey

Source

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

Get a reference to the root key

This method returns a reference to the root key.

§Example
use cobia;
use cobia::prelude::*;
cobia::cape_open_initialize().unwrap();
let root_key=cobia::CapeRegistryKey::new().unwrap(); //points to the root key
//note the absense of a leading slash in the sub-key to the root key
assert_eq!(root_key.get_string_value("name",Some("types/libraries/{8d1d724f-ab15-48e5-80e4-a612468e68d4}")).unwrap(), "CAPEOPEN_1_2".to_string()); //check name of CAPE-OPEN 1.2 type library
cobia::cape_open_cleanup();
Source

pub fn from_path(loc: &str) -> Result<CapeRegistryKey, COBIAError>

Get a reference to a key from a path

This method returns a reference to a key from a path.

§Arguments
  • loc - The path to the key to get
§Example
use cobia;
use cobia::prelude::*;
cobia::cape_open_initialize().unwrap();
let lib_key=cobia::CapeRegistryKey::from_path("/types/libraries/{8d1d724f-ab15-48e5-80e4-a612468e68d4}").unwrap(); //points to the CAPE-OPEN 1.2 type library
assert_eq!(lib_key.get_string_value("name",None).unwrap(), "CAPEOPEN_1_2".to_string()); //check its name
cobia::cape_open_cleanup();

Trait Implementations§

Source§

impl CapeRegistryKeyReader for CapeRegistryKey

Source§

fn get_values(&self) -> Result<Vec<String>, COBIAError>

Get a list of all values names in the key Read more
Source§

fn get_keys(&self) -> Result<Vec<String>, COBIAError>

Get a list of all sub key names in the key Read more
Source§

fn get_value_type( &self, value_name: &str, sub_key: Option<&str>, ) -> Result<CapeRegistryValueType, COBIAError>

Get the type of a value Read more
Source§

fn get_string_value( &self, value_name: &str, sub_key: Option<&str>, ) -> Result<String, COBIAError>

Get a string value Read more
Source§

fn get_integer_value( &self, value_name: &str, sub_key: Option<&str>, ) -> Result<i32, COBIAError>

Get an integer value Read more
Source§

fn get_uuid_value( &self, value_name: &str, sub_key: Option<&str>, ) -> Result<CapeUUID, COBIAError>

Get a UUID value Read more
Source§

fn get_sub_key(&self, key_name: &str) -> Result<CapeRegistryKey, COBIAError>

Get a sub key Read more
Source§

fn is_all_users(&self, value_name: &str) -> Result<bool, COBIAError>

Check whether a particular value is in the registry for all users or just the current user Read more
Source§

impl CapeRegistryKeyReaderKey for CapeRegistryKey

Source§

impl Clone for CapeRegistryKey

Add pointer reference

ICapeRegistryKey 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 CapeRegistryKey

Release pointer

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