pub enum LiteralValue {
Int(i64),
UInt(u64),
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.
UInt(u64)
An integer above i64::MAX, which only a u64 holds. An
integer that fits i64 is Int, so every integer has one
form (LiteralValue::unsigned). After Int, so an untagged
read takes an integer as Int when it fits.
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.
Implementations§
Source§impl LiteralValue
impl LiteralValue
Sourcepub fn unsigned(n: u64) -> LiteralValue
pub fn unsigned(n: u64) -> LiteralValue
The literal of an unsigned integer: Int when it fits i64,
UInt above.
Trait Implementations§
Source§impl Clone for LiteralValue
impl Clone for LiteralValue
Source§fn clone(&self) -> LiteralValue
fn clone(&self) -> LiteralValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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<LiteralValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LiteralValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for LiteralValue
impl PartialEq for LiteralValue
Source§impl Serialize for LiteralValue
impl Serialize for LiteralValue
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more