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 Source
s 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)
SinkError(SinkErr)
Implementations
impl<SourceErr, SinkErr> StreamError<SourceErr, SinkErr> where
SourceErr: 'static + Error,
SinkErr: 'static + Error,
impl<SourceErr, SinkErr> StreamError<SourceErr, SinkErr> where
SourceErr: 'static + Error,
SinkErr: 'static + Error,
Checks if StreamError
was raised by the Source
.
Checks if StreamError
was raised by the Sink
.
Converts StreamError
into an inner error.
Switch source and sink error.