pub enum SearchError {
FileNotFound {
path: PathBuf,
},
PermissionDenied {
path: PathBuf,
},
InvalidPattern {
message: String,
},
FileTooLarge {
path: PathBuf,
size: u64,
},
ThreadPoolError {
message: String,
},
IoError(Error),
InvalidEncoding {
path: PathBuf,
},
}Expand description
Custom error types for search operations
Variants§
FileNotFound
File not found error
PermissionDenied
Permission denied error
InvalidPattern
Invalid pattern error
FileTooLarge
File too large error
ThreadPoolError
Thread pool error
IoError(Error)
I/O error
InvalidEncoding
Invalid file encoding error
Implementations§
Source§impl SearchError
impl SearchError
Sourcepub fn file_not_found(path: &Path) -> Self
pub fn file_not_found(path: &Path) -> Self
Creates a new FileNotFound error
Sourcepub fn permission_denied(path: &Path) -> Self
pub fn permission_denied(path: &Path) -> Self
Creates a new PermissionDenied error
Sourcepub fn invalid_pattern<S: Into<String>>(message: S) -> Self
pub fn invalid_pattern<S: Into<String>>(message: S) -> Self
Creates a new InvalidPattern error
Sourcepub fn file_too_large(path: &Path, size: u64) -> Self
pub fn file_too_large(path: &Path, size: u64) -> Self
Creates a new FileTooLarge error
Sourcepub fn thread_pool_error<S: Into<String>>(message: S) -> Self
pub fn thread_pool_error<S: Into<String>>(message: S) -> Self
Creates a new ThreadPoolError error
Sourcepub fn invalid_encoding(path: &Path) -> Self
pub fn invalid_encoding(path: &Path) -> Self
Creates a new InvalidEncoding error
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Returns true if this is a FileNotFound error
Sourcepub fn is_permission_denied(&self) -> bool
pub fn is_permission_denied(&self) -> bool
Returns true if this is a PermissionDenied error
Sourcepub fn is_invalid_pattern(&self) -> bool
pub fn is_invalid_pattern(&self) -> bool
Returns true if this is an InvalidPattern error
Sourcepub fn is_file_too_large(&self) -> bool
pub fn is_file_too_large(&self) -> bool
Returns true if this is a FileTooLarge error
Sourcepub fn is_thread_pool_error(&self) -> bool
pub fn is_thread_pool_error(&self) -> bool
Returns true if this is a ThreadPoolError error
Sourcepub fn is_invalid_encoding(&self) -> bool
pub fn is_invalid_encoding(&self) -> bool
Returns true if this is an InvalidEncoding error
Trait Implementations§
Source§impl Debug for SearchError
impl Debug for SearchError
Source§impl Display for SearchError
impl Display for SearchError
Source§impl Error for SearchError
impl Error for SearchError
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 SearchError
impl !RefUnwindSafe for SearchError
impl Send for SearchError
impl Sync for SearchError
impl Unpin for SearchError
impl !UnwindSafe for SearchError
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