pub struct Param {
pub name: String,
pub value: Value,
pub accession: Option<u32>,
pub controlled_vocabulary: Option<ControlledVocabulary>,
pub unit: Unit,
}
Expand description
A controlled vocabulary or user parameter
Fields§
§name: String
§value: Value
§accession: Option<u32>
§controlled_vocabulary: Option<ControlledVocabulary>
§unit: Unit
Implementations§
Source§impl Param
impl Param
Sourcepub fn builder() -> ParamBuilder
pub fn builder() -> ParamBuilder
Create a new ParamBuilder
to make creating a new Param
more convenient.
Sourcepub fn new_key_value<K, V>(name: K, value: V) -> Param
pub fn new_key_value<K, V>(name: K, value: V) -> Param
A construction method for Param
that sets Param::name
and Param::value
but leaves all other attributes as default.
Sourcepub fn parse<T>(&self) -> Result<T, <T as FromStr>::Err>where
T: FromStr,
pub fn parse<T>(&self) -> Result<T, <T as FromStr>::Err>where
T: FromStr,
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 Param::controlled_vocabulary
and Param::accession
Sourcepub fn curie_str(&self) -> Option<String>
pub fn curie_str(&self) -> Option<String>
Format the Param::curie
as a string, if it exists
Sourcepub fn with_unit<S, A>(self, accession: S, name: A) -> Param
pub fn with_unit<S, A>(self, accession: S, name: A) -> Param
Update Param::unit
inferred from accession
, failing that, name
Sourcepub fn with_unit_t(self, unit: &Unit) -> Param
pub fn with_unit_t(self, unit: &Unit) -> Param
Update Param::unit
from unit
Trait Implementations§
Source§impl From<&DetectorTypeTerm> for Param
impl From<&DetectorTypeTerm> for Param
Source§fn from(value: &DetectorTypeTerm) -> Param
fn from(value: &DetectorTypeTerm) -> Param
Converts to this type from the input type.
Source§impl From<&DissociationEnergyTerm> for Param
impl From<&DissociationEnergyTerm> for Param
Source§fn from(value: &DissociationEnergyTerm) -> Param
fn from(value: &DissociationEnergyTerm) -> Param
Converts to this type from the input type.
Source§impl From<&DissociationMethodTerm> for Param
impl From<&DissociationMethodTerm> for Param
Source§fn from(value: &DissociationMethodTerm) -> Param
fn from(value: &DissociationMethodTerm) -> Param
Converts to this type from the input type.
Source§impl From<&InletTypeTerm> for Param
impl From<&InletTypeTerm> for Param
Source§fn from(value: &InletTypeTerm) -> Param
fn from(value: &InletTypeTerm) -> Param
Converts to this type from the input type.
Source§impl From<&IonizationTypeTerm> for Param
impl From<&IonizationTypeTerm> for Param
Source§fn from(value: &IonizationTypeTerm) -> Param
fn from(value: &IonizationTypeTerm) -> Param
Converts to this type from the input type.
Source§impl From<&MassAnalyzerTerm> for Param
impl From<&MassAnalyzerTerm> for Param
Source§fn from(value: &MassAnalyzerTerm) -> Param
fn from(value: &MassAnalyzerTerm) -> Param
Converts to this type from the input type.
Source§impl From<&MassSpectrometerFileFormatTerm> for Param
impl From<&MassSpectrometerFileFormatTerm> for Param
Source§fn from(value: &MassSpectrometerFileFormatTerm) -> Param
fn from(value: &MassSpectrometerFileFormatTerm) -> Param
Converts to this type from the input type.
Source§impl From<&NativeSpectrumIdentifierFormatTerm> for Param
impl From<&NativeSpectrumIdentifierFormatTerm> for Param
Source§fn from(value: &NativeSpectrumIdentifierFormatTerm) -> Param
fn from(value: &NativeSpectrumIdentifierFormatTerm) -> Param
Converts to this type from the input type.
Source§impl From<&SoftwareTerm> for Param
impl From<&SoftwareTerm> for Param
Source§fn from(value: &SoftwareTerm) -> Param
fn from(value: &SoftwareTerm) -> Param
Converts to this type from the input type.
Source§impl From<DataProcessingAction> for Param
impl From<DataProcessingAction> for Param
Source§fn from(value: DataProcessingAction) -> Param
fn from(value: DataProcessingAction) -> Param
Converts to this type from the input type.
Source§impl From<DetectorTypeTerm> for Param
impl From<DetectorTypeTerm> for Param
Source§fn from(value: DetectorTypeTerm) -> Param
fn from(value: DetectorTypeTerm) -> Param
Converts to this type from the input type.
Source§impl From<DissociationEnergyTerm> for Param
impl From<DissociationEnergyTerm> for Param
Source§fn from(value: DissociationEnergyTerm) -> Param
fn from(value: DissociationEnergyTerm) -> Param
Converts to this type from the input type.
Source§impl From<DissociationMethodTerm> for Param
impl From<DissociationMethodTerm> for Param
Source§fn from(value: DissociationMethodTerm) -> Param
fn from(value: DissociationMethodTerm) -> Param
Converts to this type from the input type.
Source§impl From<FormatConversion> for Param
impl From<FormatConversion> for Param
Source§fn from(value: FormatConversion) -> Param
fn from(value: FormatConversion) -> Param
Converts to this type from the input type.
Source§impl From<InletTypeTerm> for Param
impl From<InletTypeTerm> for Param
Source§fn from(value: InletTypeTerm) -> Param
fn from(value: InletTypeTerm) -> Param
Converts to this type from the input type.
Source§impl From<IonizationTypeTerm> for Param
impl From<IonizationTypeTerm> for Param
Source§fn from(value: IonizationTypeTerm) -> Param
fn from(value: IonizationTypeTerm) -> Param
Converts to this type from the input type.
Source§impl From<MassAnalyzerTerm> for Param
impl From<MassAnalyzerTerm> for Param
Source§fn from(value: MassAnalyzerTerm) -> Param
fn from(value: MassAnalyzerTerm) -> Param
Converts to this type from the input type.
Source§impl From<MassSpectrometerFileFormatTerm> for Param
impl From<MassSpectrometerFileFormatTerm> for Param
Source§fn from(value: MassSpectrometerFileFormatTerm) -> Param
fn from(value: MassSpectrometerFileFormatTerm) -> Param
Converts to this type from the input type.
Source§impl From<NativeSpectrumIdentifierFormatTerm> for Param
impl From<NativeSpectrumIdentifierFormatTerm> for Param
Source§fn from(value: NativeSpectrumIdentifierFormatTerm) -> Param
fn from(value: NativeSpectrumIdentifierFormatTerm) -> Param
Converts to this type from the input type.
Source§impl From<SoftwareTerm> for Param
impl From<SoftwareTerm> for Param
Source§fn from(value: SoftwareTerm) -> Param
fn from(value: SoftwareTerm) -> Param
Converts to this type from the input type.
Source§impl ParamLike for Param
impl ParamLike for Param
fn name(&self) -> &str
fn value(&self) -> ValueRef<'_>
fn accession(&self) -> Option<u32>
fn controlled_vocabulary(&self) -> Option<ControlledVocabulary>
fn unit(&self) -> Unit
fn is_ms(&self) -> bool
fn parse<T>(&self) -> Result<T, <T as FromStr>::Err>where
T: FromStr,
fn is_controlled(&self) -> bool
fn curie(&self) -> Option<CURIE>
Source§impl ParamValue for Param
impl ParamValue for Param
Source§fn is_f64(&self) -> bool
fn is_f64(&self) -> bool
Check if the value is a floating point
number explicitly. An integral number might
still be usable as a floating point number
Source§fn is_str(&self) -> bool
fn is_str(&self) -> bool
Check if the value is stored as an explicit string.
All variants can be coerced to a string.
Source§fn to_buffer(&self) -> Result<Cow<'_, [u8]>, ParamValueParseError>
fn to_buffer(&self) -> Result<Cow<'_, [u8]>, ParamValueParseError>
Get the value as a byte buffer, if possible. Read more
Source§fn parse<T>(&self) -> Result<T, <T as FromStr>::Err>where
T: FromStr,
fn parse<T>(&self) -> Result<T, <T as FromStr>::Err>where
T: FromStr,
Convert the value’s string representation to
T
if possibleSource§fn as_bytes(&self) -> Cow<'_, [u8]>
fn as_bytes(&self) -> Cow<'_, [u8]>
Convert the value to a byte string, the bytes
of the string representation.
Source§fn is_boolean(&self) -> bool
fn is_boolean(&self) -> bool
Check if the value is a boolean
Source§fn is_numeric(&self) -> bool
fn is_numeric(&self) -> bool
Check if the value is of either numeric type.
Source§impl TryFrom<MassSpectrometryFormat> for Param
impl TryFrom<MassSpectrometryFormat> for Param
impl Eq for Param
impl StructuralPartialEq for Param
Auto Trait Implementations§
impl Freeze for Param
impl RefUnwindSafe for Param
impl Send for Param
impl Sync for Param
impl Unpin for Param
impl UnwindSafe for Param
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key
and return true
if they are equal.