pub struct CURIE {
pub controlled_vocabulary: ControlledVocabulary,
pub accession: AccessionIntCode,
}Expand description
A CURIE is a namespace + accession identifier, of the form <namespace>:<identifier>.
A CURIE is a “compact URI”: https://www.w3.org/TR/curie/. This implementation assumes that that the accession code is a number and that an accession code is always present, which is not universally true. It is however sufficient for most use-cases in this library’s domain.
Fields§
§controlled_vocabulary: ControlledVocabularyThe controlled vocabulary namespace, e.g. MS.
accession: AccessionIntCodeThe numeric accession code within the namespace, e.g. 1000016.
Implementations§
Source§impl CURIE
impl CURIE
Sourcepub const fn new(
cv_id: ControlledVocabulary,
accession: AccessionIntCode,
) -> Self
pub const fn new( cv_id: ControlledVocabulary, accession: AccessionIntCode, ) -> Self
Sourcepub fn as_param(&self) -> Param
pub fn as_param(&self) -> Param
Create an otherwise-empty Param carrying this CURIE’s namespace and
accession, with an empty name and value.
This is technically valid, but most users will also expect Param::name to
be set.
Sourcepub const fn accession_int(&self) -> u32
pub const fn accession_int(&self) -> u32
The numeric accession code, equivalent to reading CURIE::accession directly.
Sourcepub const fn controlled_vocabulary(&self) -> ControlledVocabulary
pub const fn controlled_vocabulary(&self) -> ControlledVocabulary
The controlled vocabulary namespace, equivalent to reading
CURIE::controlled_vocabulary directly.