pub enum PolicyError {
Show 13 variants
PolicyNotFound(String),
InvalidRule(String),
PermissionDenied {
peer_id: String,
reason: String,
},
InvalidPeerId(String),
SerializationError(String),
TomlError(Error),
TooManyRules {
max: usize,
attempted: usize,
},
PatternTooLong {
max: usize,
length: usize,
},
NameTooLong {
max: usize,
length: usize,
},
ExpressionTooDeep {
max: usize,
},
ExpressionTooLong {
max: usize,
length: usize,
},
InvalidExpression(String),
InternalError(String),
}Expand description
Errors that can occur in policy operations
Variants§
PolicyNotFound(String)
Policy not found
InvalidRule(String)
Invalid policy rule
PermissionDenied
Permission denied
InvalidPeerId(String)
Invalid peer ID
SerializationError(String)
Serialization error
TomlError(Error)
TOML parsing error
TooManyRules
IO error Policy exceeds maximum allowed rules (DoS prevention - T20)
PatternTooLong
Resource pattern exceeds maximum length (DoS prevention - T20)
NameTooLong
Policy name exceeds maximum length (DoS prevention - T20)
ExpressionTooDeep
Context expression is too deeply nested (stack overflow prevention)
ExpressionTooLong
Context expression string is too long (DoS prevention)
InvalidExpression(String)
Invalid expression syntax
InternalError(String)
System time error (clock went backwards or unavailable) Internal error
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 Freeze for PolicyError
impl RefUnwindSafe for PolicyError
impl Send for PolicyError
impl Sync for PolicyError
impl Unpin for PolicyError
impl UnwindSafe 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