pub struct SemanticUnit {
pub code: Option<String>,
pub label: Option<String>,
pub custom: bool,
}Expand description
Simple semantic unit metadata for table columns.
Fields§
§code: Option<String>Stable unit code for known units, for example kg, m, GBP, or percent.
label: Option<String>Human-facing unit label. Required for custom units.
custom: boolWhether this is an explicit non-convertible custom unit.
Implementations§
Source§impl SemanticUnit
impl SemanticUnit
Sourcepub fn display_label(&self) -> Option<&str>
pub fn display_label(&self) -> Option<&str>
Return the best human-readable display label for this unit.
Trait Implementations§
Source§impl Clone for SemanticUnit
impl Clone for SemanticUnit
Source§impl Debug for SemanticUnit
impl Debug for SemanticUnit
Source§impl<'de> Deserialize<'de> for SemanticUnit
impl<'de> Deserialize<'de> for SemanticUnit
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
impl Eq for SemanticUnit
Source§impl PartialEq for SemanticUnit
impl PartialEq for SemanticUnit
Source§impl Serialize for SemanticUnit
impl Serialize for SemanticUnit
impl StructuralPartialEq for SemanticUnit
Auto Trait Implementations§
impl Freeze for SemanticUnit
impl RefUnwindSafe for SemanticUnit
impl Send for SemanticUnit
impl Sync for SemanticUnit
impl Unpin for SemanticUnit
impl UnsafeUnpin for SemanticUnit
impl UnwindSafe for SemanticUnit
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,
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
Compare self to
key and return true if they are equal.