pub enum LiteralValue {
Int(i64),
Float(f64),
String(String),
Bool(bool),
Json(Value),
}Expand description
A literal value carried in a Source::Literal. Subset of
the polydat Value type — the kinds clauses can directly
bind. Extension to richer value types lives in the source
evaluator, not the AST.
Serialized untagged because the variants are primitives;
the JSON/YAML representation is just the bare value
(1 / "x" / true / 1.5).
Variants§
Int(i64)
An integer.
Float(f64)
A float.
String(String)
A string.
Bool(bool)
A boolean.
Json(Value)
A JSON value carrying its own kind: an item of a JSON list a
generator supplied at run time, bound where the element is
declared json. Last, so an untagged read tries the scalar
forms first.
Trait Implementations§
Source§impl Clone for LiteralValue
impl Clone for LiteralValue
Source§fn clone(&self) -> LiteralValue
fn clone(&self) -> LiteralValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 LiteralValue
impl Debug for LiteralValue
Source§impl<'de> Deserialize<'de> for LiteralValue
impl<'de> Deserialize<'de> for LiteralValue
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 LiteralValue
impl PartialEq for LiteralValue
Source§impl Serialize for LiteralValue
impl Serialize for LiteralValue
impl StructuralPartialEq for LiteralValue
Auto Trait Implementations§
impl Freeze for LiteralValue
impl RefUnwindSafe for LiteralValue
impl Send for LiteralValue
impl Sync for LiteralValue
impl Unpin for LiteralValue
impl UnsafeUnpin for LiteralValue
impl UnwindSafe for LiteralValue
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