pub enum ScanError {
FileNotFound(PathBuf),
NotAFile(PathBuf),
NotADirectory(PathBuf),
ReadError {
path: PathBuf,
source: Error,
},
YamlParseError {
path: PathBuf,
source: Error,
},
JsonParseError {
path: PathBuf,
source: Error,
},
InvalidFormat {
path: PathBuf,
message: String,
},
RegexError(Error),
}Expand description
Error type for scanner operations.
Variants§
FileNotFound(PathBuf)
NotAFile(PathBuf)
NotADirectory(PathBuf)
ReadError
YamlParseError
JsonParseError
InvalidFormat
RegexError(Error)
Implementations§
Source§impl ScanError
impl ScanError
Sourcepub fn file_not_found(path: impl Into<PathBuf>) -> Self
pub fn file_not_found(path: impl Into<PathBuf>) -> Self
Create a FileNotFound error from a path-like type.
Sourcepub fn not_a_directory(path: impl Into<PathBuf>) -> Self
pub fn not_a_directory(path: impl Into<PathBuf>) -> Self
Create a NotADirectory error from a path-like type.
Sourcepub fn read_error(path: impl Into<PathBuf>, source: Error) -> Self
pub fn read_error(path: impl Into<PathBuf>, source: Error) -> Self
Create a ReadError from a path and IO error.
Sourcepub fn yaml_error(path: impl Into<PathBuf>, source: Error) -> Self
pub fn yaml_error(path: impl Into<PathBuf>, source: Error) -> Self
Create a YamlParseError from a path and YAML error.
Sourcepub fn json_error(path: impl Into<PathBuf>, source: Error) -> Self
pub fn json_error(path: impl Into<PathBuf>, source: Error) -> Self
Create a JsonParseError from a path and JSON error.
Trait Implementations§
Source§impl Error for ScanError
impl Error for ScanError
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 ScanError
impl !UnwindSafe for ScanError
impl Freeze for ScanError
impl Send for ScanError
impl Sync for ScanError
impl Unpin for ScanError
impl UnsafeUnpin for ScanError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more