Struct CompoundIdentifier
pub struct CompoundIdentifier { /* private fields */ }Expand description
A lightweight compound registry identifier.
Implementations§
§impl CompoundIdentifier
impl CompoundIdentifier
pub fn cas_number(
value: &str,
) -> Result<CompoundIdentifier, CompoundValidationError>
pub fn cas_number( value: &str, ) -> Result<CompoundIdentifier, CompoundValidationError>
Creates a CAS Registry Number identifier.
§Errors
Returns CompoundValidationError::EmptyIdentifierValue when value is empty after trimming.
pub fn pub_chem_cid(
value: &str,
) -> Result<CompoundIdentifier, CompoundValidationError>
pub fn pub_chem_cid( value: &str, ) -> Result<CompoundIdentifier, CompoundValidationError>
Creates a PubChem CID identifier.
§Errors
Returns CompoundValidationError::EmptyIdentifierValue when value is empty after trimming.
pub fn inchi(value: &str) -> Result<CompoundIdentifier, CompoundValidationError>
pub fn inchi(value: &str) -> Result<CompoundIdentifier, CompoundValidationError>
Creates an InChI identifier.
§Errors
Returns CompoundValidationError::EmptyIdentifierValue when value is empty after trimming.
pub fn inchi_key(
value: &str,
) -> Result<CompoundIdentifier, CompoundValidationError>
pub fn inchi_key( value: &str, ) -> Result<CompoundIdentifier, CompoundValidationError>
Creates an InChIKey identifier.
§Errors
Returns CompoundValidationError::EmptyIdentifierValue when value is empty after trimming.
pub fn smiles(
value: &str,
) -> Result<CompoundIdentifier, CompoundValidationError>
pub fn smiles( value: &str, ) -> Result<CompoundIdentifier, CompoundValidationError>
Creates a SMILES identifier.
§Errors
Returns CompoundValidationError::EmptyIdentifierValue when value is empty after trimming.
pub fn custom(
namespace: &str,
value: &str,
) -> Result<CompoundIdentifier, CompoundValidationError>
pub fn custom( namespace: &str, value: &str, ) -> Result<CompoundIdentifier, CompoundValidationError>
Creates a custom registry identifier.
§Errors
Returns CompoundValidationError::EmptyIdentifierNamespace when namespace is empty after
trimming, or CompoundValidationError::EmptyIdentifierValue when value is empty after trimming.
pub fn new(
registry: CompoundRegistry,
value: &str,
) -> Result<CompoundIdentifier, CompoundValidationError>
pub fn new( registry: CompoundRegistry, value: &str, ) -> Result<CompoundIdentifier, CompoundValidationError>
Creates an identifier from a registry and value.
§Errors
Returns CompoundValidationError::EmptyIdentifierValue when value is empty after trimming.
pub const fn registry(&self) -> &CompoundRegistry
pub const fn registry(&self) -> &CompoundRegistry
Returns the registry namespace.
Trait Implementations§
§impl Clone for CompoundIdentifier
impl Clone for CompoundIdentifier
§fn clone(&self) -> CompoundIdentifier
fn clone(&self) -> CompoundIdentifier
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more