Struct cedar_policy_core::ast::LiteralPolicy
source · pub struct LiteralPolicy { /* private fields */ }
Expand description
Represents either an static policy or a template linked policy This is the serializable version because it simply refers to the Template by its Id;
Implementations§
source§impl LiteralPolicy
impl LiteralPolicy
sourcepub fn reify(
self,
templates: &HashMap<PolicyID, Arc<Template>>,
) -> Result<Policy, ReificationError>
pub fn reify( self, templates: &HashMap<PolicyID, Arc<Template>>, ) -> Result<Policy, ReificationError>
Attempt to reify this template linked policy. Ensures the linked template actually exists, replaces the id with a reference to the underlying template. Fails if the template does not exist. Consumes the policy.
sourcepub fn id(&self) -> &PolicyID
pub fn id(&self) -> &PolicyID
Get the PolicyId
of this instance
If this is an inline policy, returns the ID of the inline policy
sourcepub fn template_id(&self) -> &PolicyID
pub fn template_id(&self) -> &PolicyID
Return the PolicyId
of the template or inline policy that defines this policy
Trait Implementations§
source§impl Clone for LiteralPolicy
impl Clone for LiteralPolicy
source§fn clone(&self) -> LiteralPolicy
fn clone(&self) -> LiteralPolicy
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 LiteralPolicy
impl Debug for LiteralPolicy
source§impl<'de> Deserialize<'de> for LiteralPolicy
impl<'de> Deserialize<'de> for LiteralPolicy
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 Display for LiteralPolicy
impl Display for LiteralPolicy
source§impl From<Policy> for LiteralPolicy
impl From<Policy> for LiteralPolicy
source§impl Hash for LiteralPolicy
impl Hash for LiteralPolicy
source§impl PartialEq for LiteralPolicy
impl PartialEq for LiteralPolicy
source§impl Serialize for LiteralPolicy
impl Serialize for LiteralPolicy
impl Eq for LiteralPolicy
Auto Trait Implementations§
impl Freeze for LiteralPolicy
impl RefUnwindSafe for LiteralPolicy
impl Send for LiteralPolicy
impl Sync for LiteralPolicy
impl Unpin for LiteralPolicy
impl UnwindSafe for LiteralPolicy
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