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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<S, E> StreamErrorContext for S
where S: Stream<Error = E> + Sized, E: Into<Error>,