pub struct CobiaIdentification {
pub(crate) interface: *mut ICobiaIdentification,
}Expand description
CobiaIdentification interface smart pointer
Smart pointer for ICobiaIdentification interface.
ICobiaIdentification is typically implemented in objects in ICobiaCollections.
Fields§
§interface: *mut ICobiaIdentificationImplementations§
Source§impl CobiaIdentification
impl CobiaIdentification
Sourcepub(crate) fn from_interface_pointer(
interface: *mut ICobiaIdentification,
) -> Self
pub(crate) fn from_interface_pointer( interface: *mut ICobiaIdentification, ) -> Self
Create a new CobiaIdentification from an interface pointer
Not typically called directly. Used by CapeSmartPointer.
§Safety
The interface pointer must be valid and must point to an object that implements the ICobiaIdentification interface.
§Panics
Panics if the interface pointer is null.
§Example
use cobia::*;
use cobia::prelude::*;
cobia::cape_open_initialize().unwrap();
let library_enumerator = cobia::CapeTypeLibraries::new().unwrap();
let libraries = library_enumerator.libraries().unwrap();
if libraries.size() > 0 {
let library = libraries.at(0).unwrap();
println!("Library name: {}", library.get_name().unwrap());
//create CobiaIdentification from library, undirectly calls from_interface_pointer()
let iden = cobia::CobiaIdentification::from_object(&library).unwrap();
println!("Library name: {}", iden.get_component_name().unwrap());
}
cobia::cape_open_cleanup();Sourcepub(crate) fn attach(interface: *mut ICobiaIdentification) -> Self
pub(crate) fn attach(interface: *mut ICobiaIdentification) -> Self
Create a new CobiaIdentification from an interface pointer without adding a reference
Not typically called directly. Used by CapeSmartPointer.
§Safety
The interface pointer must be valid and must point to an object that implements the ICobiaIdentification interface.
§Panics
Panics if the interface pointer is null.
Sourcepub fn get_component_name(&self) -> Result<String, COBIAError>
pub fn get_component_name(&self) -> Result<String, COBIAError>
Get the component name
Gets the name of the component
§Example
use cobia::*;
use cobia::prelude::*;
cobia::cape_open_initialize().unwrap();
let library_enumerator = cobia::CapeTypeLibraries::new().unwrap();
let libraries = library_enumerator.libraries().unwrap();
if libraries.size() > 0 {
let library = libraries.at(0).unwrap();
println!("Library name: {}", library.get_name().unwrap());
let iden = cobia::CobiaIdentification::from_object(&library).unwrap();
println!("Library name: {}", iden.get_component_name().unwrap());
}
cobia::cape_open_cleanup();Sourcepub fn put_component_name(&self, name: &str) -> Result<(), COBIAError>
pub fn put_component_name(&self, name: &str) -> Result<(), COBIAError>
Set the component name
Sets the name of the component; typically disallowed.
Only primary PMC objects typically allow for a name change.
This interface however is implemented on object from ICobiaCollection. The put_component_name method is typically not implemented on objects.
Sourcepub fn get_component_description(&self) -> Result<String, COBIAError>
pub fn get_component_description(&self) -> Result<String, COBIAError>
Get the component description
Gets the description of the component
§Example
use cobia::*;
use cobia::prelude::*;
cobia::cape_open_initialize().unwrap();
let library_enumerator = cobia::CapeTypeLibraries::new().unwrap();
let libraries = library_enumerator.libraries().unwrap();
if libraries.size() > 0 {
let library = libraries.at(0).unwrap();
println!("Library name: {}", library.get_name().unwrap());
let iden = cobia::CobiaIdentification::from_object(&library).unwrap();
println!("Library description: {}", iden.get_component_description().unwrap());
}
cobia::cape_open_cleanup();Sourcepub fn put_component_description(
&self,
description: &str,
) -> Result<(), COBIAError>
pub fn put_component_description( &self, description: &str, ) -> Result<(), COBIAError>
Set the component description
Sets the description of the component; typically disallowed.
Only primary PMC objects typically allow for a description change.
This interface however is implemented on object from ICobiaCollection. The put_component_description method is typically not implemented on objects.