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: StringThe human-readable name of the parameter.
value: ValueA type generic value associated with the parameter
accession: Option<u32>The numeric component of the accession code in the identifier for the parameter’s
definition in Self::controlled_vocabulary, if it is defined by one.
controlled_vocabulary: Option<ControlledVocabulary>The controlled vocabulary this parameter is defined in, if any.
unit: UnitThe unit the parameter’s value is expressed in, if any.
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 than
setting fields on a bare Param directly.
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
§See also
Param::with_unit_t, to infer the unit from a resolvedUnit
Sourcepub fn with_unit_t(self, unit: &Unit) -> Param
pub fn with_unit_t(self, unit: &Unit) -> Param
Set Param::unit directly from unit.
§See also
Param::with_unit, to infer the unit from an accession or name instead
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Param
impl<'de> Deserialize<'de> for Param
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Param, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Param, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Param
Source§impl From<&DetectorTypeTerm> for Param
impl From<&DetectorTypeTerm> for Param
Source§fn from(value: &DetectorTypeTerm) -> Param
fn from(value: &DetectorTypeTerm) -> Param
Source§impl From<&DissociationEnergyTerm> for Param
impl From<&DissociationEnergyTerm> for Param
Source§fn from(value: &DissociationEnergyTerm) -> Param
fn from(value: &DissociationEnergyTerm) -> Param
Source§impl From<&DissociationMethodTerm> for Param
impl From<&DissociationMethodTerm> for Param
Source§fn from(value: &DissociationMethodTerm) -> Param
fn from(value: &DissociationMethodTerm) -> Param
Source§impl From<&InletTypeTerm> for Param
impl From<&InletTypeTerm> for Param
Source§fn from(value: &InletTypeTerm) -> Param
fn from(value: &InletTypeTerm) -> Param
Source§impl From<&IonizationTypeTerm> for Param
impl From<&IonizationTypeTerm> for Param
Source§fn from(value: &IonizationTypeTerm) -> Param
fn from(value: &IonizationTypeTerm) -> Param
Source§impl From<&MassAnalyzerTerm> for Param
impl From<&MassAnalyzerTerm> for Param
Source§fn from(value: &MassAnalyzerTerm) -> Param
fn from(value: &MassAnalyzerTerm) -> Param
Source§impl From<&MassSpectrometerFileFormatTerm> for Param
impl From<&MassSpectrometerFileFormatTerm> for Param
Source§fn from(value: &MassSpectrometerFileFormatTerm) -> Param
fn from(value: &MassSpectrometerFileFormatTerm) -> Param
Source§impl From<&NativeSpectrumIdentifierFormatTerm> for Param
impl From<&NativeSpectrumIdentifierFormatTerm> for Param
Source§fn from(value: &NativeSpectrumIdentifierFormatTerm) -> Param
fn from(value: &NativeSpectrumIdentifierFormatTerm) -> Param
Source§impl From<&SoftwareTerm> for Param
impl From<&SoftwareTerm> for Param
Source§fn from(value: &SoftwareTerm) -> Param
fn from(value: &SoftwareTerm) -> Param
Source§impl From<&SpectrumType> for Param
impl From<&SpectrumType> for Param
Source§fn from(value: &SpectrumType) -> Param
fn from(value: &SpectrumType) -> Param
Source§impl From<DataProcessingAction> for Param
impl From<DataProcessingAction> for Param
Source§fn from(value: DataProcessingAction) -> Param
fn from(value: DataProcessingAction) -> Param
Source§impl From<DetectorTypeTerm> for Param
impl From<DetectorTypeTerm> for Param
Source§fn from(value: DetectorTypeTerm) -> Param
fn from(value: DetectorTypeTerm) -> Param
Source§impl From<DissociationEnergyTerm> for Param
impl From<DissociationEnergyTerm> for Param
Source§fn from(value: DissociationEnergyTerm) -> Param
fn from(value: DissociationEnergyTerm) -> Param
Source§impl From<DissociationMethodTerm> for Param
impl From<DissociationMethodTerm> for Param
Source§fn from(value: DissociationMethodTerm) -> Param
fn from(value: DissociationMethodTerm) -> Param
Source§impl From<FormatConversion> for Param
impl From<FormatConversion> for Param
Source§fn from(value: FormatConversion) -> Param
fn from(value: FormatConversion) -> Param
Source§impl From<InletTypeTerm> for Param
impl From<InletTypeTerm> for Param
Source§fn from(value: InletTypeTerm) -> Param
fn from(value: InletTypeTerm) -> Param
Source§impl From<IonizationTypeTerm> for Param
impl From<IonizationTypeTerm> for Param
Source§fn from(value: IonizationTypeTerm) -> Param
fn from(value: IonizationTypeTerm) -> Param
Source§impl From<MassAnalyzerTerm> for Param
impl From<MassAnalyzerTerm> for Param
Source§fn from(value: MassAnalyzerTerm) -> Param
fn from(value: MassAnalyzerTerm) -> Param
Source§impl From<MassSpectrometerFileFormatTerm> for Param
impl From<MassSpectrometerFileFormatTerm> for Param
Source§fn from(value: MassSpectrometerFileFormatTerm) -> Param
fn from(value: MassSpectrometerFileFormatTerm) -> Param
Source§impl From<NativeSpectrumIdentifierFormatTerm> for Param
impl From<NativeSpectrumIdentifierFormatTerm> for Param
Source§fn from(value: NativeSpectrumIdentifierFormatTerm) -> Param
fn from(value: NativeSpectrumIdentifierFormatTerm) -> Param
Source§impl From<Param> for PROXIParam
impl From<Param> for PROXIParam
Source§impl From<SoftwareTerm> for Param
impl From<SoftwareTerm> for Param
Source§fn from(value: SoftwareTerm) -> Param
fn from(value: SoftwareTerm) -> Param
Source§impl From<SpectrumType> for Param
impl From<SpectrumType> for Param
Source§fn from(value: SpectrumType) -> Param
fn from(value: SpectrumType) -> Param
Source§impl ParamLike for Param
impl ParamLike for Param
Source§fn accession(&self) -> Option<u32>
fn accession(&self) -> Option<u32>
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>(&self) -> Result<T, <T as FromStr>::Err>where
T: FromStr,
fn parse<T>(&self) -> Result<T, <T as FromStr>::Err>where
T: FromStr,
T. See ParamValue::parse.Source§fn is_controlled(&self) -> bool
fn is_controlled(&self) -> bool
Source§impl ParamValue for Param
impl ParamValue for Param
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>(&self) -> Result<T, <T as FromStr>::Err>where
T: FromStr,
fn parse<T>(&self) -> Result<T, <T as FromStr>::Err>where
T: FromStr,
T if possibleSource§fn as_bytes(&self) -> Cow<'_, [u8]>
fn as_bytes(&self) -> Cow<'_, [u8]>
Source§fn is_boolean(&self) -> bool
fn is_boolean(&self) -> bool
Source§fn is_numeric(&self) -> bool
fn is_numeric(&self) -> bool
Source§impl Serialize for Param
impl Serialize for Param
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 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 UnsafeUnpin 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
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.