sophia_api::source

Trait StreamResultExt

Source
pub trait StreamResultExt<T, E1, E2>
where E1: Error, E2: Error,
{ // Required methods fn map_source_err<E, F>(self, f: F) -> StreamResult<T, E, E2> where E: Error, F: FnOnce(E1) -> E; fn map_sink_err<E, F>(self, f: F) -> StreamResult<T, E1, E> where E: Error, F: FnOnce(E2) -> E; }
Expand description

Additional methods for StreamResult

Required Methods§

Source

fn map_source_err<E, F>(self, f: F) -> StreamResult<T, E, E2>
where E: Error, F: FnOnce(E1) -> E,

Map the error if it is a SourceError

Source

fn map_sink_err<E, F>(self, f: F) -> StreamResult<T, E1, E>
where E: Error, F: FnOnce(E2) -> E,

Map the error if it is a SinkError

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, E1, E2> StreamResultExt<T, E1, E2> for StreamResult<T, E1, E2>
where E1: Error, E2: Error,