pub enum ValueKind {
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 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 Value
s 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 Literal
s as elements
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ValueKind
impl<'de> Deserialize<'de> for ValueKind
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<T: Into<Literal>> From<T> for ValueKind
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
Converts to this type from the input type.
Source§impl<T: Into<Value>> From<Vec<T>> for ValueKind
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
Converts
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>
Converts
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