pub struct LiteralPolicySet { /* private fields */ }Expand description
A Policy Set that contains less rich information than PolicySet.
In particular, this form is easier to convert to/from the Protobuf
representation of a PolicySet, because policies are represented as
LiteralPolicy instead of Policy.
Implementations§
Source§impl LiteralPolicySet
impl LiteralPolicySet
Sourcepub fn new(
templates: impl IntoIterator<Item = (PolicyID, Template)>,
links: impl IntoIterator<Item = (PolicyID, LiteralPolicy)>,
) -> Self
pub fn new( templates: impl IntoIterator<Item = (PolicyID, Template)>, links: impl IntoIterator<Item = (PolicyID, LiteralPolicy)>, ) -> Self
Create a new LiteralPolicySet. Caller is responsible for ensuring the
invariants on LiteralPolicySet.
Sourcepub fn templates(&self) -> impl Iterator<Item = &Template>
pub fn templates(&self) -> impl Iterator<Item = &Template>
Iterate over the Templates in the LiteralPolicySet. This will
include both templates and static policies (represented as templates
with zero slots)
Sourcepub fn policies(&self) -> impl Iterator<Item = &LiteralPolicy>
pub fn policies(&self) -> impl Iterator<Item = &LiteralPolicy>
Iterate over the LiteralPolicys in the LiteralPolicySet. This will
include both static and template-linked policies.
Trait Implementations§
Source§impl Debug for LiteralPolicySet
impl Debug for LiteralPolicySet
Source§impl From<PolicySet> for LiteralPolicySet
impl From<PolicySet> for LiteralPolicySet
Source§impl TryFrom<LiteralPolicySet> for PolicySet
Converts a LiteralPolicySet into a PolicySet, ensuring the invariants are met
Every Policy must point to a Template that exists in the set.
impl TryFrom<LiteralPolicySet> for PolicySet
Converts a LiteralPolicySet into a PolicySet, ensuring the invariants are met
Every Policy must point to a Template that exists in the set.
Source§type Error = ReificationError
type Error = ReificationError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for LiteralPolicySet
impl RefUnwindSafe for LiteralPolicySet
impl Send for LiteralPolicySet
impl Sync for LiteralPolicySet
impl Unpin for LiteralPolicySet
impl UnwindSafe for LiteralPolicySet
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> 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