pub enum EntityValue {
Str(String),
Int(PaddedInt),
Float(f64),
Bool(bool),
Json(Value),
}Expand description
A typed entity value, preserving the original representation where needed.
Most entity values are strings (e.g., sub-01 → Str("01")), but some
are typed as integers (preserving zero-padding via PaddedInt),
floats, or booleans. The Json variant is used for
metadata values merged from JSON sidecars.
§Conversions
From<&str>andFrom<String>→EntityValue::StrFrom<i32>andFrom<i64>→EntityValue::IntFrom<f64>→EntityValue::FloatFrom<bool>→EntityValue::Bool
Variants§
Implementations§
Source§impl EntityValue
impl EntityValue
Sourcepub fn as_str_lossy(&self) -> Cow<'_, str>
pub fn as_str_lossy(&self) -> Cow<'_, str>
Get the value as a string representation.
Returns a Cow::Borrowed for Str variants (zero-copy) and
Cow::Owned for all others.
Trait Implementations§
Source§impl Clone for EntityValue
impl Clone for EntityValue
Source§fn clone(&self) -> EntityValue
fn clone(&self) -> EntityValue
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 EntityValue
impl Debug for EntityValue
Source§impl<'de> Deserialize<'de> for EntityValue
impl<'de> Deserialize<'de> for EntityValue
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 Display for EntityValue
impl Display for EntityValue
Source§impl From<&str> for EntityValue
impl From<&str> for EntityValue
Source§impl From<String> for EntityValue
impl From<String> for EntityValue
Source§impl From<bool> for EntityValue
impl From<bool> for EntityValue
Source§impl From<f64> for EntityValue
impl From<f64> for EntityValue
Source§impl From<i32> for EntityValue
impl From<i32> for EntityValue
Source§impl From<i64> for EntityValue
impl From<i64> for EntityValue
Source§impl Hash for EntityValue
impl Hash for EntityValue
Source§impl PartialEq for EntityValue
impl PartialEq for EntityValue
Source§impl Serialize for EntityValue
impl Serialize for EntityValue
impl Eq for EntityValue
Auto Trait Implementations§
impl Freeze for EntityValue
impl RefUnwindSafe for EntityValue
impl Send for EntityValue
impl Sync for EntityValue
impl Unpin for EntityValue
impl UnsafeUnpin for EntityValue
impl UnwindSafe for EntityValue
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,
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.