#[non_exhaustive]pub enum PolicyError {
Parse(Error),
Version {
found: u32,
supported: u32,
},
DuplicateId(String),
EmptyRule(String),
EmptyPattern,
BadGlob {
pattern: String,
error: Error,
},
BadShellPattern {
pattern: String,
},
Rule {
rule: String,
problem: String,
},
}Expand description
Why a policy file cannot be used. Any of these keeps guard from deciding.
Messages include their cause, so no variant also exposes it as source:
a chained report ({:#}) would print it twice.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Parse(Error)
The file is not valid YAML or does not fit the schema.
Version
The version key names a schema this build does not know.
DuplicateId(String)
Two rule groups share an id.
EmptyRule(String)
A rule group lists no patterns.
EmptyPattern
A pattern is empty (or only !/$).
BadGlob
A glob does not compile.
BadShellPattern
A shell pattern does not tokenise (unbalanced quotes, a here-document).
Rule
A rule group or executables entry is invalid; problem says why.
Trait Implementations§
Source§impl Debug for PolicyError
impl Debug for PolicyError
Source§impl Display for PolicyError
impl Display for PolicyError
Source§impl Error for PolicyError
impl Error for PolicyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for PolicyError
impl !UnwindSafe for PolicyError
impl Freeze for PolicyError
impl Send for PolicyError
impl Sync for PolicyError
impl Unpin for PolicyError
impl UnsafeUnpin for PolicyError
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