Struct cedar_policy::RestrictedExpression
source · pub struct RestrictedExpression(/* private fields */);
Expand description
“Restricted” expressions are used for attribute values and context
.
Restricted expressions can contain only the following:
- bool, int, and string literals
- literal
EntityUid
s such asUser::"alice"
- extension function calls, where the arguments must be other things on this list
- set and record literals, where the values must be other things on this list
That means the following are not allowed in restricted expressions:
principal
,action
,resource
,context
- builtin operators and functions, including
.
,in
,has
,like
,.contains()
- if-then-else expressions
Implementations§
source§impl RestrictedExpression
impl RestrictedExpression
sourcepub fn new_string(value: String) -> Self
pub fn new_string(value: String) -> Self
Create an expression representing a literal string.
sourcepub fn new_record(fields: impl IntoIterator<Item = (String, Self)>) -> Self
pub fn new_record(fields: impl IntoIterator<Item = (String, Self)>) -> Self
Create an expression representing a record.
sourcepub fn new_set(values: impl IntoIterator<Item = Self>) -> Self
pub fn new_set(values: impl IntoIterator<Item = Self>) -> Self
Create an expression representing a Set.
Trait Implementations§
source§impl Clone for RestrictedExpression
impl Clone for RestrictedExpression
source§fn clone(&self) -> RestrictedExpression
fn clone(&self) -> RestrictedExpression
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RestrictedExpression
impl Debug for RestrictedExpression
source§impl FromStr for RestrictedExpression
impl FromStr for RestrictedExpression
Auto Trait Implementations§
impl Freeze for RestrictedExpression
impl RefUnwindSafe for RestrictedExpression
impl Send for RestrictedExpression
impl Sync for RestrictedExpression
impl Unpin for RestrictedExpression
impl UnwindSafe for RestrictedExpression
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