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 ICapeRegistryKeyImplementations§
Source§impl CapeRegistryKey
impl CapeRegistryKey
Sourcepub fn new() -> Result<CapeRegistryKey, COBIAError>
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();Sourcepub fn from_path(loc: &str) -> Result<CapeRegistryKey, COBIAError>
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
impl CapeRegistryKeyReader for CapeRegistryKey
Source§fn get_values(&self) -> Result<Vec<String>, COBIAError>
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>
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>
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>
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>
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>
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>
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>
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
impl CapeRegistryKeyReaderKey for CapeRegistryKey
fn get_read_key(&self) -> *mut ICapeRegistryKey
Source§impl Clone for CapeRegistryKey
Add pointer reference
impl Clone for CapeRegistryKey
Add pointer reference
ICapeRegistryKey derives from ICobiaBase, which contains addReference() and release(). The Clone trait calls addReference.
Auto Trait Implementations§
impl Freeze for CapeRegistryKey
impl RefUnwindSafe for CapeRegistryKey
impl !Send for CapeRegistryKey
impl !Sync for CapeRegistryKey
impl Unpin for CapeRegistryKey
impl UnwindSafe for CapeRegistryKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more