pub enum ClValue {
Str(String),
Int(i64),
Float(f64),
Bool(bool),
Var(String),
List(Vec<ClValue>),
Map(BTreeMap<String, ClValue>),
Bytes(Vec<u8>),
Measured {
value: Box<ClValue>,
unit: String,
},
}Expand description
Typed content value (§27): the CL’s own type system. Wire-compatible
with plain msgpack/JSON values (Str→string, Int→integer, …) so existing
encoders keep working — but Rust-level code now knows the TYPE.
Var is the exception: it serializes as a single-key map {"$var": name} to stay unambiguous with Str.
Variants§
Str(String)
Int(i64)
Float(f64)
Bool(bool)
Var(String)
§28: reference to a Bind binding or a quantified variable.
List(Vec<ClValue>)
Map(BTreeMap<String, ClValue>)
Bytes(Vec<u8>)
Measured
§32: value with unit of measure — {"$measured": {"value": v, "unit": "ms"}}. Prevents the classic inter-agent unit confusion.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ClValue
impl<'de> Deserialize<'de> for ClValue
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ClValue> for FieldValue
impl From<ClValue> for FieldValue
impl StructuralPartialEq for ClValue
Auto Trait Implementations§
impl Freeze for ClValue
impl RefUnwindSafe for ClValue
impl Send for ClValue
impl Sync for ClValue
impl Unpin for ClValue
impl UnsafeUnpin for ClValue
impl UnwindSafe for ClValue
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