pub struct Require {
pub protection: Option<RequiredLevel>,
pub agents: BTreeMap<String, RequiredLevel>,
}Expand description
The require: section of a policy, a repository policy or a pack.
Fields§
§protection: Option<RequiredLevel>The least level of every agent; absent, none.
agents: BTreeMap<String, RequiredLevel>The least level of one agent, by its host id (as openmoat status names it), in
place of Self::protection for that agent in this file. Another
source’s higher level still applies (Policy::required_for).
Implementations§
Source§impl Require
impl Require
Sourcepub fn for_agent(&self, host: Option<&str>) -> Option<RequiredLevel>
pub fn for_agent(&self, host: Option<&str>) -> Option<RequiredLevel>
What this section asks of host (a host id), or of a program that is
no known agent when host is None: only Self::protection.
Sourcepub fn agent_ids(&self) -> impl Iterator<Item = &str>
pub fn agent_ids(&self) -> impl Iterator<Item = &str>
Every host id Self::agents names, for the CLI to check against the
hosts it knows.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Require
impl<'de> Deserialize<'de> for Require
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 Eq for Require
impl StructuralPartialEq for Require
Auto Trait Implementations§
impl Forget for Require
impl Freeze for Require
impl RefUnwindSafe for Require
impl Send for Require
impl Sync for Require
impl Unpin for Require
impl UnsafeUnpin for Require
impl UnwindSafe for Require
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