Trait grep_searcher::SinkError [−][src]
pub trait SinkError: Sized { fn error_message<T: Display>(message: T) -> Self; fn error_io(err: Error) -> Self { ... } fn error_config(err: ConfigError) -> Self { ... } }
A trait that describes errors that can be reported by searchers and
implementations of Sink
.
Unless you have a specialized use case, you probably don't need to
implement this trait explicitly. It's likely that using io::Error
(which
implements this trait) for your error type is good enough, largely because
most errors that occur during search will likely be an io::Error
.
Required Methods
fn error_message<T: Display>(message: T) -> Self
A constructor for converting any value that satisfies the
fmt::Display
trait into an error.
Provided Methods
fn error_io(err: Error) -> Self
A constructor for converting I/O errors that occur while searching into an error of this type.
By default, this is implemented via the error_message
constructor.
fn error_config(err: ConfigError) -> Self
A constructor for converting configuration errors that occur while building a searcher into an error of this type.
By default, this is implemented via the error_message
constructor.
Implementations on Foreign Types
impl SinkError for Error
[src]
impl SinkError for Error
An io::Error
can be used as an error for Sink
implementations out of
the box.
fn error_message<T: Display>(message: T) -> Error
[src]
fn error_message<T: Display>(message: T) -> Error
fn error_io(err: Error) -> Error
[src]
fn error_io(err: Error) -> Error
fn error_config(err: ConfigError) -> Self
[src]
fn error_config(err: ConfigError) -> Self
impl SinkError for Box<Error>
[src]
impl SinkError for Box<Error>
A Box<std::error::Error>
can be used as an error for Sink
implementations out of the box.
fn error_message<T: Display>(message: T) -> Box<Error>
[src]
fn error_message<T: Display>(message: T) -> Box<Error>
fn error_io(err: Error) -> Self
[src]
fn error_io(err: Error) -> Self
fn error_config(err: ConfigError) -> Self
[src]
fn error_config(err: ConfigError) -> Self