pub struct RepoPolicy {
pub version: u32,
pub deny: Vec<RuleGroup>,
pub allow: Vec<RuleGroup>,
pub ask: Vec<RuleGroup>,
}Expand description
A repository policy. Only rules: defaults, executables and sandbox
stay the user’s, so any other key is a parse error.
Fields§
§version: u32Schema version; only 1 is supported.
deny: Vec<RuleGroup>Added to the user’s deny rules.
allow: Vec<RuleGroup>Added to the user’s allow rules, only when the file is trusted.
ask: Vec<RuleGroup>Tried before the user’s allow rules.
Implementations§
Source§impl RepoPolicy
impl RepoPolicy
Sourcepub fn parse(yaml: &str) -> Result<Self, PolicyError>
pub fn parse(yaml: &str) -> Result<Self, PolicyError>
Parse and lint a repository policy. Pure: takes the YAML text.
Trait Implementations§
Source§impl Clone for RepoPolicy
impl Clone for RepoPolicy
Source§impl Debug for RepoPolicy
impl Debug for RepoPolicy
Source§impl<'de> Deserialize<'de> for RepoPolicy
impl<'de> Deserialize<'de> for RepoPolicy
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 RepoPolicy
Source§impl PartialEq for RepoPolicy
impl PartialEq for RepoPolicy
impl StructuralPartialEq for RepoPolicy
Auto Trait Implementations§
impl Freeze for RepoPolicy
impl RefUnwindSafe for RepoPolicy
impl Send for RepoPolicy
impl Sync for RepoPolicy
impl Unpin for RepoPolicy
impl UnsafeUnpin for RepoPolicy
impl UnwindSafe for RepoPolicy
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.