Struct cedar_policy_core::est::Policy
source · pub struct Policy { /* private fields */ }
Expand description
Serde JSON structure for policies and templates in the EST format
Implementations§
source§impl Policy
impl Policy
sourcepub fn link(
self,
vals: &HashMap<SlotId, EntityUidJSON>,
) -> Result<Self, InstantiationError>
pub fn link( self, vals: &HashMap<SlotId, EntityUidJSON>, ) -> Result<Self, InstantiationError>
Fill in any slots in the policy using the values in vals
. Throws an
error if vals
doesn’t contain a necessary mapping, but does not throw
an error if vals
contains unused mappings – and in particular if
self
is an inline policy (in which case it is returned unchanged).
source§impl Policy
impl Policy
sourcepub fn try_into_ast_policy(
self,
id: Option<PolicyID>,
) -> Result<Policy, EstToAstError>
pub fn try_into_ast_policy( self, id: Option<PolicyID>, ) -> Result<Policy, EstToAstError>
Try to convert EST Policy into AST Policy.
This process requires a policy ID. If not supplied, this method will fill it in as “JSON policy”.
sourcepub fn try_into_ast_template(
self,
id: Option<PolicyID>,
) -> Result<Template, EstToAstError>
pub fn try_into_ast_template( self, id: Option<PolicyID>, ) -> Result<Template, EstToAstError>
Try to convert EST Policy into AST Template.
This process requires a policy ID. If not supplied, this method will fill it in as “JSON policy”.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Policy
impl<'de> Deserialize<'de> for Policy
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 Policy
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnwindSafe for Policy
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