Struct ordered_stream::Join
source · pub struct Join<A, B>where
A: OrderedStream,
B: OrderedStream<Data = A::Data, Ordering = A::Ordering>,{ /* private fields */ }
Expand description
A stream for the join
function.
Implementations§
source§impl<A, B> Join<A, B>where
A: OrderedStream,
B: OrderedStream<Data = A::Data, Ordering = A::Ordering>,
impl<A, B> Join<A, B>where A: OrderedStream, B: OrderedStream<Data = A::Data, Ordering = A::Ordering>,
sourcepub fn into_inner(self) -> (A, B, Option<(A::Data, A::Ordering)>)
pub fn into_inner(self) -> (A, B, Option<(A::Data, A::Ordering)>)
Split into the source streams.
This method returns the source streams along with any buffered item and its ordering.
sourcepub fn stream_a(self: Pin<&mut Self>) -> Pin<&mut A>
pub fn stream_a(self: Pin<&mut Self>) -> Pin<&mut A>
Provide direct access to the underlying stream.
This may be useful if the stream provides APIs beyond OrderedStream. Note that the join itself may be buffering an item from this stream, so you should consult Self::peek_buffered and, if needed, Self::take_buffered before polling it directly.
sourcepub fn stream_b(self: Pin<&mut Self>) -> Pin<&mut B>
pub fn stream_b(self: Pin<&mut Self>) -> Pin<&mut B>
Provide direct access to the underlying stream.
This may be useful if the stream provides APIs beyond OrderedStream. Note that the join itself may be buffering an item from this stream, so you should consult Self::peek_buffered and, if needed, Self::take_buffered before polling it directly.
sourcepub fn peek_buffered(
self: Pin<&mut Self>
) -> (Option<(&mut A::Data, &A::Ordering)>, Option<(&mut B::Data, &B::Ordering)>)
pub fn peek_buffered( self: Pin<&mut Self> ) -> (Option<(&mut A::Data, &A::Ordering)>, Option<(&mut B::Data, &B::Ordering)>)
Allow access to the buffered item, if any.
At most one of the two sides will be Some
. The returned item is a candidate for being
the next item returned by the joined stream, but it could not be returned by the most
recent OrderedStream::poll_next_before
call.
sourcepub fn take_buffered(self: Pin<&mut Self>) -> Option<(A::Data, A::Ordering)>
pub fn take_buffered(self: Pin<&mut Self>) -> Option<(A::Data, A::Ordering)>
Remove the buffered item, if one is present.
This does not poll either underlying stream. See Self::peek_buffered for details on why buffering exists.
Trait Implementations§
source§impl<A, B> Debug for Join<A, B>where
A: OrderedStream + Debug,
B: OrderedStream<Data = A::Data, Ordering = A::Ordering> + Debug,
A::Data: Debug,
B::Data: Debug,
A::Ordering: Debug,
impl<A, B> Debug for Join<A, B>where A: OrderedStream + Debug, B: OrderedStream<Data = A::Data, Ordering = A::Ordering> + Debug, A::Data: Debug, B::Data: Debug, A::Ordering: Debug,
source§impl<A, B> FusedOrderedStream for Join<A, B>where
A: OrderedStream,
B: OrderedStream<Data = A::Data, Ordering = A::Ordering>,
impl<A, B> FusedOrderedStream for Join<A, B>where A: OrderedStream, B: OrderedStream<Data = A::Data, Ordering = A::Ordering>,
source§fn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
true
if the stream should no longer be polled.source§impl<A, B> OrderedStream for Join<A, B>where
A: OrderedStream,
B: OrderedStream<Data = A::Data, Ordering = A::Ordering>,
impl<A, B> OrderedStream for Join<A, B>where A: OrderedStream, B: OrderedStream<Data = A::Data, Ordering = A::Ordering>,
§type Data = <A as OrderedStream>::Data
type Data = <A as OrderedStream>::Data
§type Ordering = <A as OrderedStream>::Ordering
type Ordering = <A as OrderedStream>::Ordering
source§fn poll_next_before(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
before: Option<&Self::Ordering>
) -> Poll<PollResult<Self::Ordering, Self::Data>>
fn poll_next_before( self: Pin<&mut Self>, cx: &mut Context<'_>, before: Option<&Self::Ordering> ) -> Poll<PollResult<Self::Ordering, Self::Data>>
NoneBefore
if it is known that the stream will not produce any
more values ordered before the given point. Read more