pub enum ValueKind {
Lit(Literal),
Set(Set),
Record(Arc<BTreeMap<SmolStr, Value>>),
ExtensionValue(Arc<RepresentableExtensionValue>),
}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<RepresentableExtensionValue>)
Evaluating an Expr can result in an extension value
Implementations§
Source§impl ValueKind
impl ValueKind
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
Sourcepub fn record<K: Into<SmolStr>, V: Into<Value>>(
pairs: impl IntoIterator<Item = (K, V)>,
) -> Self
pub fn record<K: Into<SmolStr>, V: Into<Value>>( pairs: impl IntoIterator<Item = (K, V)>, ) -> Self
Create a record with the given (key, value) pairs
Sourcepub fn record_arc(pairs: Arc<BTreeMap<SmolStr, Value>>) -> Self
pub fn record_arc(pairs: Arc<BTreeMap<SmolStr, Value>>) -> Self
Create a record with the given attributes/value mapping.
Sourcepub fn all_literal_uids(&self) -> HashSet<EntityUID>
pub fn all_literal_uids(&self) -> HashSet<EntityUID>
All literal uids referenced by this value kind
Trait Implementations§
Source§impl BoundedDisplay for ValueKind
impl BoundedDisplay for ValueKind
Source§impl<T: Into<Literal>> From<T> for ValueKind
Create a ValueKind directly from a Literal, or from anything that implements
Into<Literal> (so Integer, &str, EntityUID, etc)
impl<T: Into<Literal>> From<T> for ValueKind
Create a ValueKind directly from a Literal, or from anything that implements
Into<Literal> (so Integer, &str, EntityUID, etc)
Source§impl From<ValueKind> for RestrictedExpr
impl From<ValueKind> for RestrictedExpr
Source§fn from(value: ValueKind) -> RestrictedExpr
fn from(value: ValueKind) -> RestrictedExpr
Source§impl<T: Into<Value>> From<Vec<T>> for ValueKind
Create a ValueKind directly from a Vec<Value>, or Vec<T> where T: Into<Value>
(so Vec<Integer>, Vec<String>, etc)
impl<T: Into<Value>> From<Vec<T>> for ValueKind
Create a ValueKind directly from a Vec<Value>, or Vec<T> where T: Into<Value>
(so Vec<Integer>, Vec<String>, etc)
Source§impl Ord for ValueKind
impl Ord for ValueKind
Source§impl PartialOrd for ValueKind
impl PartialOrd for ValueKind
impl Eq for ValueKind
Auto Trait Implementations§
impl Freeze for ValueKind
impl RefUnwindSafe for ValueKind
impl Send for ValueKind
impl Sync for ValueKind
impl Unpin for ValueKind
impl UnwindSafe for ValueKind
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> BoundedToString for Twhere
T: BoundedDisplay,
impl<T> BoundedToString for Twhere
T: BoundedDisplay,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
key and return true if they are equal.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