pub enum MetaValue {
None,
Bool(bool),
Int(i64),
Str(Arc<str>),
List(Vec<MetaValue>),
Tuple(Vec<MetaValue>),
Map(BTreeMap<String, MetaValue>),
}Expand description
Structured metadata values (used by Textual handlers and richer annotations).
This is intentionally deterministic and Eq so it can be compared / merged
and used in segment simplification.
Variants§
None
Bool(bool)
Int(i64)
Str(Arc<str>)
List(Vec<MetaValue>)
Tuple(Vec<MetaValue>)
Map(BTreeMap<String, MetaValue>)
Implementations§
Source§impl MetaValue
impl MetaValue
pub fn str(value: impl Into<Arc<str>>) -> Self
Sourcepub fn parse_python_literal(input: &str) -> Option<Self>
pub fn parse_python_literal(input: &str) -> Option<Self>
Parse a small, deterministic subset of Python literals (like ast.literal_eval).
Supported:
None,True,False- integers (base-10)
- quoted strings
'...'/"..."with basic escapes - lists
[a, b] - tuples
(a, b)(single element tuples require a trailing comma, like Python) - dicts
{'k': 1}(string keys only)
Trait Implementations§
impl Eq for MetaValue
impl StructuralPartialEq for MetaValue
Auto Trait Implementations§
impl Freeze for MetaValue
impl RefUnwindSafe for MetaValue
impl Send for MetaValue
impl Sync for MetaValue
impl Unpin for MetaValue
impl UnwindSafe for MetaValue
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.