pub struct WithContext<St, F, E> { /* private fields */ }
Expand description

Stream for the with_context combinator.

See the TryStreamExt::with_context method for more details.

Trait Implementations§

source§

impl<St: Debug, F: Debug, E: Debug> Debug for WithContext<St, F, E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<St, F, C, E> Stream for WithContext<St, F, E>where St: TryStream, F: FnMut(&mut St::Error) -> C, C: IntoError<E, Source = St::Error>, E: Error + ErrorCompat,

§

type Item = Result<<St as TryStream>::Ok, E>

Values yielded by the stream.
source§

fn poll_next( self: Pin<&mut Self>, ctx: &mut TaskContext<'_> ) -> Poll<Option<Self::Item>>

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the stream. Read more
source§

impl<'pin, St, F, E> Unpin for WithContext<St, F, E>where __WithContext<'pin, St, F, E>: Unpin,

Auto Trait Implementations§

§

impl<St, F, E> RefUnwindSafe for WithContext<St, F, E>where E: RefUnwindSafe, F: RefUnwindSafe, St: RefUnwindSafe,

§

impl<St, F, E> Send for WithContext<St, F, E>where E: Send, F: Send, St: Send,

§

impl<St, F, E> Sync for WithContext<St, F, E>where E: Sync, F: Sync, St: Sync,

§

impl<St, F, E> UnwindSafe for WithContext<St, F, E>where E: UnwindSafe, F: UnwindSafe, St: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S, T, E> TryStream for Swhere S: Stream<Item = Result<T, E>> + ?Sized,

§

type Ok = T

The type of successful values yielded by this future
§

type Error = E

The type of failures yielded by this future
§

fn try_poll_next( self: Pin<&mut S>, cx: &mut Context<'_> ) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>

Poll this TryStream as if it were a Stream. Read more
source§

impl<St> TryStreamExt for Stwhere St: TryStream,

source§

fn context<C, E>(self, context: C) -> Context<St, C, E>where C: IntoError<E, Source = <St as TryStream>::Error> + Clone, E: Error + ErrorCompat,

Extend a [TryStream]’s error with additional context-sensitive information. Read more
source§

fn with_context<F, C, E>(self, context: F) -> WithContext<St, F, E>where F: FnMut(&mut <St as TryStream>::Error) -> C, C: IntoError<E, Source = <St as TryStream>::Error>, E: Error + ErrorCompat,

Extend a [TryStream]’s error with lazily-generated context-sensitive information. Read more
source§

fn whatever_context<S, E>(self, context: S) -> WhateverContext<St, S, E>where S: Into<String>, E: FromString,

Extend a [TryStream]’s error with information from a string. Read more
source§

fn with_whatever_context<F, S, E>( self, context: F ) -> WithWhateverContext<St, F, E>where F: FnMut(&mut <St as TryStream>::Error) -> S, S: Into<String>, E: FromString,

Extend a [TryStream]’s error with information from a lazily-generated string. Read more