Skip to main content

ParamCow

Struct ParamCow 

Source
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: Unit

Implementations§

Source§

impl ParamCow<'static>

Source

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>

Source

pub fn new( name: Cow<'a, str>, value: ValueRef<'a>, accession: Option<AccessionIntCode>, controlled_vocabulary: Option<ControlledVocabulary>, unit: Unit, ) -> Self

Source

pub fn parse<T: FromStr>(&self) -> Result<T, T::Err>

Source

pub const fn is_controlled(&self) -> bool

Source

pub const fn curie(&self) -> Option<CURIE>

Trait Implementations§

Source§

impl<'a> AsRef<ValueRef<'a>> for ParamCow<'a>

Source§

fn as_ref(&self) -> &ValueRef<'a>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a> Clone for ParamCow<'a>

Source§

fn clone(&self) -> ParamCow<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for ParamCow<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for ParamCow<'a>

Source§

fn default() -> ParamCow<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> Eq for ParamCow<'a>

Source§

impl<'a> From<ParamCow<'a>> for Param

Source§

fn from(value: ParamCow<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> ParamLike for ParamCow<'a>

Source§

impl<'a> ParamValue for ParamCow<'a>

Source§

fn is_empty(&self) -> bool

Check if the value is empty
Source§

fn is_i64(&self) -> bool

Check if the value is an integer
Source§

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_buffer(&self) -> bool

Check if the value is an arbitrary buffer
Source§

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_f64(&self) -> Result<f64, ParamValueParseError>

Get the value as an f64, if possible
Source§

fn to_i64(&self) -> Result<i64, ParamValueParseError>

Get the value as an i64, if possible
Source§

fn to_str(&self) -> Cow<'_, str>

Get the value as a string
Source§

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>

Convert the value’s string representation to T if possible
Source§

fn as_bytes(&self) -> Cow<'_, [u8]>

Convert the value to a byte string, the bytes of the string representation.
Source§

fn as_ref(&self) -> ValueRef<'_>

Get a reference to the stored value
Source§

fn data_len(&self) -> usize

Get the size of the stored data type
Source§

fn is_boolean(&self) -> bool

Check if the value is a boolean
Source§

fn to_bool(&self) -> Result<bool, ParamValueParseError>

Get the value as a bool, if possible
Source§

fn is_list(&self) -> bool

Check if the value is a list
Source§

fn as_slice(&self) -> Cow<'_, [Value]>

Get the value as a slice
Source§

fn is_numeric(&self) -> bool

Check if the value is of either numeric type.
Source§

fn to_f32(&self) -> Result<f32, ParamValueParseError>

Get the value as an f32, if possible
Source§

fn to_i32(&self) -> Result<i32, ParamValueParseError>

Get the value as an i32, if possible
Source§

fn to_u64(&self) -> Result<u64, ParamValueParseError>

Get the value as an u64, if possible
Source§

fn as_str(&self) -> Cow<'_, str>

Get the value as a string, possibly borrowed
Source§

impl<'a> PartialEq for ParamCow<'a>

Source§

fn eq(&self, other: &ParamCow<'a>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialEq<CURIE> for ParamCow<'_>

Source§

fn eq(&self, other: &CURIE) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialEq<Param> for ParamCow<'_>

Source§

fn eq(&self, other: &Param) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> PartialEq<ParamCow<'a>> for Param

Source§

fn eq(&self, other: &ParamCow<'a>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for ParamCow<'a>

Source§

impl<'a> TryFrom<&ParamCow<'a>> for CURIE

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_from(value: &ParamCow<'a>) -> Result<Self, Self::Error>

Performs the conversion.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.