Enum cedar_policy_core::est::Expr
source · pub enum Expr {
ExprNoExt(ExprNoExt),
ExtFuncCall(ExtFuncCall),
}
Expand description
Serde JSON structure for a Cedar expression in the EST format
Variants§
ExprNoExt(ExprNoExt)
Any Cedar expression other than an extension function call. We try to match this first, see docs on #[serde(untagged)].
ExtFuncCall(ExtFuncCall)
If that didn’t match (because the key is not one of the keys defined in
ExprNoExt
), we assume we have an extension function call, where the
key is the name of an extension function or method.
Implementations§
source§impl Expr
impl Expr
sourcepub fn contains_all(left: Arc<Expr>, right: Expr) -> Self
pub fn contains_all(left: Arc<Expr>, right: Expr) -> Self
left.containsAll(right)
sourcepub fn contains_any(left: Arc<Expr>, right: Expr) -> Self
pub fn contains_any(left: Arc<Expr>, right: Expr) -> Self
left.containsAny(right)
sourcepub fn ite(cond_expr: Expr, then_expr: Expr, else_expr: Expr) -> Self
pub fn ite(cond_expr: Expr, then_expr: Expr, else_expr: Expr) -> Self
if cond_expr then then_expr else else_expr
sourcepub fn record(map: HashMap<SmolStr, Expr>) -> Self
pub fn record(map: HashMap<SmolStr, Expr>) -> Self
e.g. {foo: 1+2, bar: !(context has department)}
sourcepub fn ext_call(fn_name: SmolStr, args: Vec<Expr>) -> Self
pub fn ext_call(fn_name: SmolStr, args: Vec<Expr>) -> Self
extension function call, including method calls
sourcepub fn into_string_literal(self) -> Option<SmolStr>
pub fn into_string_literal(self) -> Option<SmolStr>
Consume the Expr
, producing a string literal if it was a string literal, otherwise None
Trait Implementations§
source§impl<'de> Deserialize<'de> for Expr
impl<'de> Deserialize<'de> for Expr
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
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnwindSafe for Expr
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