Enum sophia_api::quad::stream::StreamError[][src]

pub enum StreamError<SourceErr, SinkErr> where
    SourceErr: 'static + Error,
    SinkErr: 'static + Error
{ SourceError(SourceErr), SinkError(SinkErr), }
Expand description

A error that is raised by functions that move fallible Sources into fallible Sinks.

In case this error is raised it can be matched to investigate if Source or Sink failed.

Conversion

Both variants SourceError and SinkError are public exported. Consequently, StreamError can be constructed with .map_err(SourceError) and .map_err(SinkError).

ToDo

For a proper use in multi-threaded environments the trait bounds should be supplied with + Send + Sync. However, such bounds wound make StreamError incompatible with sophia’s whole error-handling. This should be resolved when the error-handling is completely refactored (tracking issue).

Variants

SourceError(SourceErr)

Tuple Fields

0: SourceErr

SinkError(SinkErr)

Tuple Fields

0: SinkErr

Implementations

Checks if StreamError was raised by the Source.

Checks if StreamError was raised by the Sink.

Converts StreamError into an inner error.

Unwrap as the inner SourceError.

Panic

Panic if self is actually a SinkError.

Unwrap as the inner SinkError.

Panic

Panic if self is actually a SourceError.

Switch source and sink error.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.