pub struct CURIE {
pub controlled_vocabulary: ControlledVocabulary,
pub accession: u32,
}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: u32The numeric accession code within the namespace, e.g. 1000016.
Implementations§
Source§impl CURIE
impl CURIE
Sourcepub const fn new(cv_id: ControlledVocabulary, accession: u32) -> CURIE
pub const fn new(cv_id: ControlledVocabulary, accession: u32) -> CURIE
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.
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for CURIE
impl<'__de, __Context> BorrowDecode<'__de, __Context> for CURIE
Source§fn borrow_decode<__D>(decoder: &mut __D) -> Result<CURIE, DecodeError>where
__D: BorrowDecoder<'__de, Context = __Context>,
fn borrow_decode<__D>(decoder: &mut __D) -> Result<CURIE, DecodeError>where
__D: BorrowDecoder<'__de, Context = __Context>,
impl Copy for CURIE
Source§impl<'de> Deserialize<'de> for CURIE
impl<'de> Deserialize<'de> for CURIE
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CURIE, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CURIE, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for CURIE
Source§impl Serialize for CURIE
impl Serialize for CURIE
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for CURIE
Source§impl TryFrom<OboIdentifier> for CURIE
impl TryFrom<OboIdentifier> for CURIE
Source§type Error = CURIEParsingError
type Error = CURIEParsingError
Source§fn try_from(
value: OboIdentifier,
) -> Result<CURIE, <CURIE as TryFrom<OboIdentifier>>::Error>
fn try_from( value: OboIdentifier, ) -> Result<CURIE, <CURIE as TryFrom<OboIdentifier>>::Error>
Auto Trait Implementations§
impl Freeze for CURIE
impl RefUnwindSafe for CURIE
impl Send for CURIE
impl Sync for CURIE
impl Unpin for CURIE
impl UnsafeUnpin for CURIE
impl UnwindSafe for CURIE
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.