[][src]Trait grep_searcher::SinkError

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.

Loading content...

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.

Loading content...

Implementations on Foreign Types

impl SinkError for Error[src]

An io::Error can be used as an error for Sink implementations out of the box.

fn error_config(err: ConfigError) -> Self[src]

impl SinkError for Box<dyn Error>[src]

A Box<std::error::Error> can be used as an error for Sink implementations out of the box.

fn error_io(err: Error) -> Self[src]

fn error_config(err: ConfigError) -> Self[src]

Loading content...

Implementors

Loading content...