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
and does not contain a reference to the Template
itself
Implementations§
Source§impl LiteralPolicy
impl LiteralPolicy
Sourcepub fn static_policy(template_id: PolicyID) -> Self
pub fn static_policy(template_id: PolicyID) -> Self
Create a LiteralPolicy
representing a static policy with the given ID.
The policy set should also contain a (zero-slot) Template
with the given ID.
Sourcepub fn template_linked_policy(
template_id: PolicyID,
link_id: PolicyID,
values: SlotEnv,
) -> Self
pub fn template_linked_policy( template_id: PolicyID, link_id: PolicyID, values: SlotEnv, ) -> Self
Create a LiteralPolicy
representing a template-linked policy.
The policy set should also contain the associated Template
.
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 template_id(&self) -> &PolicyID
pub fn template_id(&self) -> &PolicyID
Get the PolicyID
of the template associated with this policy.
For static policies, this is just the static policy ID.
Trait Implementations§
Source§impl Clone for LiteralPolicy
impl Clone for LiteralPolicy
Source§fn clone(&self) -> LiteralPolicy
fn clone(&self) -> LiteralPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
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
impl StructuralPartialEq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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