pub struct ParamCow<'a> {
pub name: Cow<'a, str>,
pub value: ValueRef<'a>,
pub accession: Option<AccessionIntCode>,
pub controlled_vocabulary: Option<ControlledVocabulary>,
pub unit: Unit,
}Expand description
A statically allocate-able or non-owned data version of Param
Fields§
§name: Cow<'a, str>The human-readable name of the parameter.
value: ValueRef<'a>The parameter’s value.
accession: Option<AccessionIntCode>The numeric accession code within controlled_vocabulary, if this parameter is
drawn from a controlled vocabulary.
controlled_vocabulary: Option<ControlledVocabulary>The controlled vocabulary this parameter’s term belongs to. None for a
free-text, user-defined parameter.
unit: UnitThe unit the value is expressed in, if known.
Implementations§
Source§impl ParamCow<'static>
impl ParamCow<'static>
Sourcepub const fn const_new(
name: &'static str,
value: ValueRef<'static>,
accession: Option<AccessionIntCode>,
controlled_vocabulary: Option<ControlledVocabulary>,
unit: Unit,
) -> Self
pub const fn const_new( name: &'static str, value: ValueRef<'static>, accession: Option<AccessionIntCode>, controlled_vocabulary: Option<ControlledVocabulary>, unit: Unit, ) -> Self
Build a ParamCow<'static> in a const context. Prefer
ControlledVocabulary::const_param and its siblings, which fill in the namespace
for you.
Source§impl<'a> ParamCow<'a>
impl<'a> ParamCow<'a>
Sourcepub fn new(
name: Cow<'a, str>,
value: ValueRef<'a>,
accession: Option<AccessionIntCode>,
controlled_vocabulary: Option<ControlledVocabulary>,
unit: Unit,
) -> Self
pub fn new( name: Cow<'a, str>, value: ValueRef<'a>, accession: Option<AccessionIntCode>, controlled_vocabulary: Option<ControlledVocabulary>, unit: Unit, ) -> Self
Build a ParamCow from its parts directly.
Sourcepub fn parse<T: FromStr>(&self) -> Result<T, T::Err>
pub fn parse<T: FromStr>(&self) -> Result<T, T::Err>
Attempt to parse the value of this parameter into T.
See Value::parse
Sourcepub const fn is_controlled(&self) -> bool
pub const fn is_controlled(&self) -> bool
Check if this parameter is defined in a controlled vocabulary
Sourcepub const fn curie(&self) -> Option<CURIE>
pub const fn curie(&self) -> Option<CURIE>
Create a CURIE from ParamCow::controlled_vocabulary and ParamCow::accession
Trait Implementations§
impl<'a> Eq for ParamCow<'a>
Source§impl<'a> ParamLike for ParamCow<'a>
impl<'a> ParamLike for ParamCow<'a>
Source§fn accession(&self) -> Option<AccessionIntCode>
fn accession(&self) -> Option<AccessionIntCode>
ParamLike::controlled_vocabulary, if this
parameter is drawn from a controlled vocabulary.Source§fn controlled_vocabulary(&self) -> Option<ControlledVocabulary>
fn controlled_vocabulary(&self) -> Option<ControlledVocabulary>
Source§fn is_ms(&self) -> bool
fn is_ms(&self) -> bool
Source§fn parse<T: FromStr>(&self) -> Result<T, T::Err>
fn parse<T: FromStr>(&self) -> Result<T, T::Err>
T. See ParamValue::parse.Source§fn is_controlled(&self) -> bool
fn is_controlled(&self) -> bool
Source§impl<'a> ParamValue for ParamCow<'a>
impl<'a> ParamValue for ParamCow<'a>
Source§fn is_f64(&self) -> bool
fn is_f64(&self) -> bool
Source§fn is_str(&self) -> bool
fn is_str(&self) -> bool
Source§fn to_buffer(&self) -> Result<Cow<'_, [u8]>, ParamValueParseError>
fn to_buffer(&self) -> Result<Cow<'_, [u8]>, ParamValueParseError>
Source§fn parse<T: FromStr>(&self) -> Result<T, T::Err>
fn parse<T: FromStr>(&self) -> Result<T, T::Err>
T if possible