Trait StreamErrorContext

Source
pub trait StreamErrorContext: Stream + Sized {
    // Required methods
    fn context<D>(self, context: D) -> ContextStream<Self, D>
       where D: Display + Clone + Send + Sync + 'static;
    fn with_context<D, F>(self, f: F) -> WithContextStream<Self, F>
       where D: Display + Clone + Send + Sync + 'static,
             F: FnMut() -> D;
}
Expand description

“Context” support for streams.

Required Methods§

Source

fn context<D>(self, context: D) -> ContextStream<Self, D>
where D: Display + Clone + Send + Sync + 'static,

Add context to the error returned by this stream

Source

fn with_context<D, F>(self, f: F) -> WithContextStream<Self, F>
where D: Display + Clone + Send + Sync + 'static, F: FnMut() -> D,

Add context created by provided function to the error returned by this stream

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<S, E> StreamErrorContext for S
where S: Stream<Error = E> + Sized, E: Into<Error>,