Enum cedar_policy_core::ast::Value
source · 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
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
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
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
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
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 PartialEq for Value
impl PartialEq for Value
source§impl PartialOrd for Value
impl PartialOrd for Value
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more