pub enum MetadataValue {
Text(String),
Integer(i64),
Float(f64),
Boolean(bool),
DateTime(String),
Tags(Vec<String>),
Enum {
value: String,
options: Vec<String>,
},
Qualitative {
value: String,
scale: Vec<String>,
},
Quantitative {
value: f64,
unit: String,
},
Json(Value),
}Expand description
Metadata value types
Variants§
Text(String)
Text string
Integer(i64)
Integer number
Float(f64)
Floating point number
Boolean(bool)
Boolean value
DateTime(String)
ISO 8601 timestamp
Tags(Vec<String>)
Array of strings (tags, labels)
Enum
Enum value (predefined set of options)
Qualitative
Qualitative measure (e.g., “high”, “medium”, “low”)
Quantitative
Quantitative measure with unit
Json(Value)
JSON object for complex nested data
Implementations§
Source§impl MetadataValue
impl MetadataValue
Sourcepub fn datetime_now() -> Self
pub fn datetime_now() -> Self
Create a datetime value from timestamp
Create tags from strings
Sourcepub fn enum_value(
value: impl Into<String>,
options: Vec<String>,
) -> Result<Self>
pub fn enum_value( value: impl Into<String>, options: Vec<String>, ) -> Result<Self>
Create enum with validation
Sourcepub fn qualitative(value: impl Into<String>, scale: Vec<String>) -> Result<Self>
pub fn qualitative(value: impl Into<String>, scale: Vec<String>) -> Result<Self>
Create qualitative value
Sourcepub fn quantitative(value: f64, unit: impl Into<String>) -> Self
pub fn quantitative(value: f64, unit: impl Into<String>) -> Self
Create quantitative value
Trait Implementations§
Source§impl Clone for MetadataValue
impl Clone for MetadataValue
Source§fn clone(&self) -> MetadataValue
fn clone(&self) -> MetadataValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetadataValue
impl Debug for MetadataValue
Source§impl<'de> Deserialize<'de> for MetadataValue
impl<'de> Deserialize<'de> for MetadataValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MetadataValue
impl PartialEq for MetadataValue
Source§impl Serialize for MetadataValue
impl Serialize for MetadataValue
impl StructuralPartialEq for MetadataValue
Auto Trait Implementations§
impl Freeze for MetadataValue
impl RefUnwindSafe for MetadataValue
impl Send for MetadataValue
impl Sync for MetadataValue
impl Unpin for MetadataValue
impl UnwindSafe for MetadataValue
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