pub enum PolicyError {
Show 13 variants
EmptyPath,
ExpectedAbsolute {
path: PathBuf,
},
ExpectedRelative {
path: PathBuf,
},
PathContainsNul {
path: PathBuf,
},
ParentTraversal {
path: PathBuf,
},
InvalidDomainPattern {
pattern: String,
},
ResolvedAddressMismatch {
literal: String,
address: SocketAddr,
},
InvalidGlobPattern {
pattern: String,
reason: String,
},
UnsupportedGlobAccess {
access: AccessMode,
},
InvalidProtectedPath {
path: PathBuf,
reason: String,
},
InvalidContext {
message: String,
},
InvalidRule {
message: String,
},
InvalidLocalIpcEndpoint {
endpoint: String,
reason: &'static str,
},
}Expand description
Errors returned when a policy value cannot represent a safe request.
Variants§
EmptyPath
A path argument was empty.
ExpectedAbsolute
A path that must be absolute was relative.
ExpectedRelative
A path that must be workspace-relative was absolute.
PathContainsNul
A path contained a NUL character that an operating-system backend cannot use.
ParentTraversal
A workspace-relative path attempts to escape its root.
InvalidDomainPattern
A domain pattern is empty or malformed.
ResolvedAddressMismatch
An IP-literal target claimed a resolved address for a different IP.
Fields
address: SocketAddrThe inconsistent address in the resolution snapshot.
InvalidGlobPattern
A filesystem glob is empty or malformed.
Fields
UnsupportedGlobAccess
A glob requested an access mode that is not portable across backends.
Fields
access: AccessModeThe access mode requested for the glob.
InvalidProtectedPath
A protected relative path is empty or unsafe.
Fields
InvalidContext
A path resolution context contains an invalid value.
InvalidRule
A policy rule is internally inconsistent.
InvalidLocalIpcEndpoint
A local-IPC endpoint is malformed or cannot be represented safely.
Trait Implementations§
Source§impl Clone for PolicyError
impl Clone for PolicyError
Source§impl Debug for PolicyError
impl Debug for PolicyError
Source§impl Display for PolicyError
impl Display for PolicyError
impl Eq 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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()