pub struct Join<A, B>{ /* private fields */ }
Expand description
A stream for the join
function.
Implementations§
source§impl<A, B> Join<A, B>
impl<A, B> Join<A, B>
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> FusedOrderedStream for Join<A, B>
impl<A, B> FusedOrderedStream for Join<A, B>
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>
impl<A, B> OrderedStream for Join<A, B>
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 moresource§fn position_hint(&self) -> Option<MaybeBorrowed<'_, Self::Ordering>>
fn position_hint(&self) -> Option<MaybeBorrowed<'_, Self::Ordering>>
impl<'__pin, A, B> Unpin for Join<A, B>where
PinnedFieldsOf<__Origin<'__pin, A, B>>: Unpin,
A: OrderedStream,
B: OrderedStream<Data = A::Data, Ordering = A::Ordering>,
Auto Trait Implementations§
impl<A, B> Freeze for Join<A, B>where
A: Freeze,
B: Freeze,
<A as OrderedStream>::Data: Freeze,
<A as OrderedStream>::Ordering: Freeze,
impl<A, B> RefUnwindSafe for Join<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
<A as OrderedStream>::Data: RefUnwindSafe,
<A as OrderedStream>::Ordering: RefUnwindSafe,
impl<A, B> Send for Join<A, B>
impl<A, B> Sync for Join<A, B>
impl<A, B> UnwindSafe for Join<A, B>where
A: UnwindSafe,
B: UnwindSafe,
<A as OrderedStream>::Data: UnwindSafe,
<A as OrderedStream>::Ordering: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> OrderedStreamExt for Twhere
T: OrderedStream + ?Sized,
impl<T> OrderedStreamExt for Twhere
T: OrderedStream + ?Sized,
source§fn map_item<F, R>(self, f: F) -> MapItem<Self, F>
fn map_item<F, R>(self, f: F) -> MapItem<Self, F>
source§fn map_ordering<NewOrdering, NewData, MapInto, MapFrom>(
self,
map_into: MapInto,
map_from: MapFrom,
) -> MapOrdering<Self, MapInto, MapFrom>where
Self: Sized,
MapInto: FnMut(Self::Ordering, Self::Data) -> (NewOrdering, NewData),
MapFrom: FnMut(&NewOrdering) -> Option<Self::Ordering>,
NewOrdering: Ord,
fn map_ordering<NewOrdering, NewData, MapInto, MapFrom>(
self,
map_into: MapInto,
map_from: MapFrom,
) -> MapOrdering<Self, MapInto, MapFrom>where
Self: Sized,
MapInto: FnMut(Self::Ordering, Self::Data) -> (NewOrdering, NewData),
MapFrom: FnMut(&NewOrdering) -> Option<Self::Ordering>,
NewOrdering: Ord,
fn filter<F>(self, filter: F) -> Filter<Self, F>
fn filter_map<F, R>(self, filter: F) -> FilterMap<Self, F>
source§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
Stream
, discarding the ordering information.source§fn into_tuple_stream(self) -> IntoTupleStream<Self>where
Self: Sized,
fn into_tuple_stream(self) -> IntoTupleStream<Self>where
Self: Sized,
Stream
, keeping the ordering objects.source§fn into_ordering(self) -> IntoOrdering<Self>where
Self: Sized,
fn into_ordering(self) -> IntoOrdering<Self>where
Self: Sized,
Stream
, keeping only the ordering objects.source§fn next_before<'a>(
&'a mut self,
before: Option<&'a Self::Ordering>,
) -> NextBefore<'a, Self> ⓘwhere
Self: Unpin,
fn next_before<'a>(
&'a mut self,
before: Option<&'a Self::Ordering>,
) -> NextBefore<'a, Self> ⓘwhere
Self: Unpin,
PollResult
corresponding to the next item in the stream.