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>§value: ValueRef<'a>§accession: Option<AccessionIntCode>§controlled_vocabulary: Option<ControlledVocabulary>§unit: UnitImplementations§
Source§impl ParamCow<'static>
impl ParamCow<'static>
pub const fn const_new( name: &'static str, value: ValueRef<'static>, accession: Option<AccessionIntCode>, controlled_vocabulary: Option<ControlledVocabulary>, unit: Unit, ) -> Self
Source§impl<'a> ParamCow<'a>
impl<'a> ParamCow<'a>
pub fn new( name: Cow<'a, str>, value: ValueRef<'a>, accession: Option<AccessionIntCode>, controlled_vocabulary: Option<ControlledVocabulary>, unit: Unit, ) -> Self
pub fn parse<T: FromStr>(&self) -> Result<T, T::Err>
pub const fn is_controlled(&self) -> bool
pub const fn curie(&self) -> Option<CURIE>
Trait Implementations§
impl<'a> Eq for ParamCow<'a>
Source§impl<'a> ParamLike for ParamCow<'a>
impl<'a> ParamLike for ParamCow<'a>
fn name(&self) -> &str
fn value(&self) -> ValueRef<'a>
fn accession(&self) -> Option<AccessionIntCode>
fn controlled_vocabulary(&self) -> Option<ControlledVocabulary>
fn unit(&self) -> Unit
fn is_ms(&self) -> bool
fn parse<T: FromStr>(&self) -> Result<T, T::Err>
fn is_controlled(&self) -> bool
fn curie(&self) -> Option<CURIE>
Source§impl<'a> ParamValue for ParamCow<'a>
impl<'a> ParamValue for ParamCow<'a>
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: FromStr>(&self) -> Result<T, T::Err>
fn parse<T: FromStr>(&self) -> Result<T, T::Err>
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.
impl<'a> StructuralPartialEq for ParamCow<'a>
Auto Trait Implementations§
impl<'a> Freeze for ParamCow<'a>
impl<'a> RefUnwindSafe for ParamCow<'a>
impl<'a> Send for ParamCow<'a>
impl<'a> Sync for ParamCow<'a>
impl<'a> Unpin for ParamCow<'a>
impl<'a> UnsafeUnpin for ParamCow<'a>
impl<'a> UnwindSafe for ParamCow<'a>
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