pub enum PolicyLoadError {
Io(FileSystemError),
InvalidUtf8(FromUtf8Error),
Parse(String),
Validation(String),
}Expand description
Errors surfaced by the policy/baseline/waiver loaders.
Variants partition the failure modes the loaders can report so callers
can distinguish “file missing / IO failure” from “schema mismatch” from
“validation rule rejected the contents”. Pre-fix the loaders returned
std::io::Error for all three, forcing callers to inspect
ErrorKind to discriminate.
Variants§
Io(FileSystemError)
Filesystem failure (path missing, permission denied, …).
InvalidUtf8(FromUtf8Error)
File contents are not valid UTF-8.
Parse(String)
Deserialisation (JSON or YAML) failed.
Validation(String)
File parsed but failed schema/semantic validation.
Trait Implementations§
Source§impl Debug for PolicyLoadError
impl Debug for PolicyLoadError
Source§impl Display for PolicyLoadError
impl Display for PolicyLoadError
Source§impl Error for PolicyLoadError
impl Error for PolicyLoadError
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 From<FileSystemError> for PolicyLoadError
impl From<FileSystemError> for PolicyLoadError
Source§fn from(source: FileSystemError) -> Self
fn from(source: FileSystemError) -> Self
Converts to this type from the input type.
Source§impl From<FromUtf8Error> for PolicyLoadError
impl From<FromUtf8Error> for PolicyLoadError
Source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
Converts to this type from the input type.
Source§impl From<PolicyLoadError> for ScanError
impl From<PolicyLoadError> for ScanError
Source§fn from(source: PolicyLoadError) -> Self
fn from(source: PolicyLoadError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PolicyLoadError
impl !RefUnwindSafe for PolicyLoadError
impl Send for PolicyLoadError
impl Sync for PolicyLoadError
impl Unpin for PolicyLoadError
impl UnsafeUnpin for PolicyLoadError
impl !UnwindSafe for PolicyLoadError
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