pub enum Value {
Lit(Literal),
Set(Set),
Record(Arc<BTreeMap<SmolStr, Value>>),
ExtensionValue(Arc<ExtensionValueWithArgs>),
}Expand description
This describes all the values which could be the dynamic result of evaluating an Expr.
Cloning is O(1).
Variants§
Lit(Literal)
anything that is a Literal can also be the dynamic result of evaluating an Expr
Set(Set)
Evaluating an Expr can result in a first-class set
Record(Arc<BTreeMap<SmolStr, Value>>)
Evaluating an Expr can result in a first-class anonymous record (keyed on String)
ExtensionValue(Arc<ExtensionValueWithArgs>)
Evaluating an Expr can result in an extension value
Implementations§
Source§impl Value
impl Value
Sourcepub fn empty_record() -> Self
pub fn empty_record() -> Self
Create a new empty record
Sourcepub fn set(vals: impl IntoIterator<Item = Value>) -> Self
pub fn set(vals: impl IntoIterator<Item = Value>) -> Self
Create a set with the given Values as elements
Sourcepub fn set_of_lits(lits: impl IntoIterator<Item = Literal>) -> Self
pub fn set_of_lits(lits: impl IntoIterator<Item = Literal>) -> Self
Create a set with the given Literals as elements
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
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>,
Source§impl<S> From<BTreeMap<S, Value>> for Value
Create a Value::Record from a map of String to Value
impl<S> From<BTreeMap<S, Value>> for Value
Create a Value::Record from a map of String to Value
Source§impl<S> From<HashMap<S, Value>> for Value
As above, create a Value::Record from a map of SmolStr to Value.
This implementation provides conversion from HashMap while the earlier
implementation provides conversion from BTreeMap
impl<S> From<HashMap<S, Value>> for Value
As above, create a Value::Record from a map of SmolStr to Value.
This implementation provides conversion from HashMap while the earlier
implementation provides conversion from BTreeMap
Source§impl<T: Into<Literal>> From<T> for Value
Create a Value directly from a Literal, or from anything that implements
Into<Literal> (so i64, &str, EntityUID, etc)
impl<T: Into<Literal>> From<T> for Value
Create a Value directly from a Literal, or from anything that implements
Into<Literal> (so i64, &str, EntityUID, etc)
Source§impl From<Vec<(SmolStr, Value)>> for Value
Create a Value directly from a Vec of (String, Value) pairs, which
will be interpreted as (field, value) pairs for a first-class record
impl From<Vec<(SmolStr, Value)>> for Value
Create a Value directly from a Vec of (String, Value) pairs, which
will be interpreted as (field, value) pairs for a first-class record
Source§impl<T: Into<Value>> From<Vec<T>> for Value
Create a Value directly from a Vec<Value>, or Vec<T> where T: Into<Value>
(so Vec<i64>, Vec<String>, etc)
impl<T: Into<Value>> From<Vec<T>> for Value
Create a Value directly from a Vec<Value>, or Vec<T> where T: Into<Value>
(so Vec<i64>, Vec<String>, etc)
Source§impl FromIterator<Value> for Set
impl FromIterator<Value> for Set
Source§impl Ord for Value
impl Ord for Value
Source§impl PartialOrd for Value
impl PartialOrd for Value
Source§impl TryFrom<PartialValue> for Value
impl TryFrom<PartialValue> for Value
impl Eq for Value
Auto Trait Implementations§
impl Freeze for Value
impl !RefUnwindSafe for Value
impl !Send for Value
impl !Sync for Value
impl Unpin for Value
impl !UnwindSafe for Value
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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