pub struct CompoundIdentifier { /* private fields */ }Expand description
A lightweight compound registry identifier.
Implementations§
Source§impl CompoundIdentifier
impl CompoundIdentifier
Sourcepub fn cas_number(value: &str) -> Result<Self, CompoundValidationError>
pub fn cas_number(value: &str) -> Result<Self, CompoundValidationError>
Creates a CAS Registry Number identifier.
§Errors
Returns CompoundValidationError::EmptyIdentifierValue when value is empty after trimming.
Sourcepub fn pub_chem_cid(value: &str) -> Result<Self, CompoundValidationError>
pub fn pub_chem_cid(value: &str) -> Result<Self, CompoundValidationError>
Creates a PubChem CID identifier.
§Errors
Returns CompoundValidationError::EmptyIdentifierValue when value is empty after trimming.
Sourcepub fn inchi(value: &str) -> Result<Self, CompoundValidationError>
pub fn inchi(value: &str) -> Result<Self, CompoundValidationError>
Creates an InChI identifier.
§Errors
Returns CompoundValidationError::EmptyIdentifierValue when value is empty after trimming.
Sourcepub fn inchi_key(value: &str) -> Result<Self, CompoundValidationError>
pub fn inchi_key(value: &str) -> Result<Self, CompoundValidationError>
Creates an InChIKey identifier.
§Errors
Returns CompoundValidationError::EmptyIdentifierValue when value is empty after trimming.
Sourcepub fn smiles(value: &str) -> Result<Self, CompoundValidationError>
pub fn smiles(value: &str) -> Result<Self, CompoundValidationError>
Creates a SMILES identifier.
§Errors
Returns CompoundValidationError::EmptyIdentifierValue when value is empty after trimming.
Sourcepub fn custom(
namespace: &str,
value: &str,
) -> Result<Self, CompoundValidationError>
pub fn custom( namespace: &str, value: &str, ) -> Result<Self, 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.
Sourcepub fn new(
registry: CompoundRegistry,
value: &str,
) -> Result<Self, CompoundValidationError>
pub fn new( registry: CompoundRegistry, value: &str, ) -> Result<Self, CompoundValidationError>
Creates an identifier from a registry and value.
§Errors
Returns CompoundValidationError::EmptyIdentifierValue when value is empty after trimming.
Sourcepub const fn registry(&self) -> &CompoundRegistry
pub const fn registry(&self) -> &CompoundRegistry
Returns the registry namespace.
Trait Implementations§
Source§impl Clone for CompoundIdentifier
impl Clone for CompoundIdentifier
Source§fn clone(&self) -> CompoundIdentifier
fn clone(&self) -> CompoundIdentifier
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompoundIdentifier
impl Debug for CompoundIdentifier
Source§impl Display for CompoundIdentifier
impl Display for CompoundIdentifier
Source§impl Hash for CompoundIdentifier
impl Hash for CompoundIdentifier
Source§impl Ord for CompoundIdentifier
impl Ord for CompoundIdentifier
Source§fn cmp(&self, other: &CompoundIdentifier) -> Ordering
fn cmp(&self, other: &CompoundIdentifier) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CompoundIdentifier
impl PartialEq for CompoundIdentifier
Source§fn eq(&self, other: &CompoundIdentifier) -> bool
fn eq(&self, other: &CompoundIdentifier) -> bool
self and other values to be equal, and is used by ==.