#[non_exhaustive]pub enum CommandPolicyError {
NotAllowed {
command: String,
},
Blocked {
command: String,
pattern: String,
},
DangerousPattern {
command: String,
pattern: String,
},
}Expand description
Errors returned when a command fails policy validation.
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.
NotAllowed
The command’s executable is not on the allowlist.
Blocked
The command matched a denylist pattern.
DangerousPattern
The command matched a dangerous pattern (defense-in-depth check).
Trait Implementations§
Source§impl Clone for CommandPolicyError
impl Clone for CommandPolicyError
Source§fn clone(&self) -> CommandPolicyError
fn clone(&self) -> CommandPolicyError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandPolicyError
impl Debug for CommandPolicyError
Source§impl Display for CommandPolicyError
impl Display for CommandPolicyError
Source§impl Error for CommandPolicyError
impl Error for CommandPolicyError
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()
Source§impl PartialEq for CommandPolicyError
impl PartialEq for CommandPolicyError
impl Eq for CommandPolicyError
impl StructuralPartialEq for CommandPolicyError
Auto Trait Implementations§
impl Freeze for CommandPolicyError
impl RefUnwindSafe for CommandPolicyError
impl Send for CommandPolicyError
impl Sync for CommandPolicyError
impl Unpin for CommandPolicyError
impl UnsafeUnpin for CommandPolicyError
impl UnwindSafe for CommandPolicyError
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