pub struct PolicySet {
pub templates: LinkedHashMap<PolicyID, Policy>,
pub static_policies: LinkedHashMap<PolicyID, Policy>,
pub template_links: Vec<TemplateLink>,
}Expand description
Serde JSON structure for a policy set in the EST format
Fields§
§templates: LinkedHashMap<PolicyID, Policy>The set of templates in a policy set
static_policies: LinkedHashMap<PolicyID, Policy>The set of static policies in a policy set
template_links: Vec<TemplateLink>The set of template links
Implementations§
Source§impl PolicySet
impl PolicySet
Sourcepub fn get_policy(&self, id: &PolicyID) -> Option<Policy>
pub fn get_policy(&self, id: &PolicyID) -> Option<Policy>
Get the static or template-linked policy with the given id.
Returns an Option rather than a Result because it is expected to be
used in cases where the policy set is guaranteed to be well-formed
(e.g., after successful conversion to an ast::PolicySet)
Sourcepub fn get_template(&self, id: &PolicyID) -> Option<Policy>
pub fn get_template(&self, id: &PolicyID) -> Option<Policy>
Get the template with the given id.
Returns an Option rather than a Result because it is expected to be
used in cases where the policy set is guaranteed to be well-formed
(e.g., after successful conversion to an ast::PolicySet)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PolicySet
impl<'de> Deserialize<'de> for PolicySet
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
Auto Trait Implementations§
impl Freeze for PolicySet
impl RefUnwindSafe for PolicySet
impl Send for PolicySet
impl Sync for PolicySet
impl Unpin for PolicySet
impl UnwindSafe for PolicySet
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§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