pub struct StreamSinkPair<S, R> { /* private fields */ }Expand description
Wraps a pair of Stream and Sink.
Implements StreamSink.
Implementations§
Source§impl<S, R> StreamSinkPair<S, R>
impl<S, R> StreamSinkPair<S, R>
Sourcepub fn new(stream: S, sink: R) -> Self
pub fn new(stream: S, sink: R) -> Self
Creates new StreamSinkPair.
Sourcepub fn get_pinned_pair(
self: Pin<&mut Self>,
) -> (Option<Pin<&mut S>>, Pin<&mut R>)
pub fn get_pinned_pair( self: Pin<&mut Self>, ) -> (Option<Pin<&mut S>>, Pin<&mut R>)
Gets pinned reference for inner data.
Sourcepub fn unwrap_pair(self) -> (Option<S>, R)
pub fn unwrap_pair(self) -> (Option<S>, R)
Unwraps self into it’s content.
Trait Implementations§
Source§impl<S, R, Is, Ir, E> StreamSink<Is, Ir> for StreamSinkPair<S, R>
impl<S, R, Is, Ir, E> StreamSink<Is, Ir> for StreamSinkPair<S, R>
Source§fn poll_stream_sink(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> State<Is, Self::Error>
fn poll_stream_sink( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> State<Is, Self::Error>
Poll the
StreamSink. Read moreSource§fn start_send(self: Pin<&mut Self>, item: Ir) -> Result<(), Self::Error>
fn start_send(self: Pin<&mut Self>, item: Ir) -> Result<(), Self::Error>
Starts sending item into
StreamSink. Read moreimpl<'__pin, S, R> Unpin for StreamSinkPair<S, R>where
PinnedFieldsOf<__Origin<'__pin, S, R>>: Unpin,
Auto Trait Implementations§
impl<S, R> Freeze for StreamSinkPair<S, R>
impl<S, R> RefUnwindSafe for StreamSinkPair<S, R>where
R: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, R> Send for StreamSinkPair<S, R>
impl<S, R> Sync for StreamSinkPair<S, R>
impl<S, R> UnwindSafe for StreamSinkPair<S, R>where
R: UnwindSafe,
S: 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
Mutably borrows from an owned value. Read more
Source§impl<SI, RI, T> StreamSinkExt<SI, RI> for Twhere
T: StreamSink<SI, RI>,
impl<SI, RI, T> StreamSinkExt<SI, RI> for Twhere
T: StreamSink<SI, RI>,
Source§fn error_cast<E>(self) -> ErrorCast<Self, E>
fn error_cast<E>(self) -> ErrorCast<Self, E>
Cast the error type.
Source§fn chain<Other, Item>(self, other: Other) -> Chain<Self, Other, SendItem>
fn chain<Other, Item>(self, other: Other) -> Chain<Self, Other, SendItem>
Chain two
StreamSink. Read moreSource§fn send_one<'a>(
self: Pin<&'a mut Self>,
item: RecvItem,
) -> SendOne<'a, Self, SendItem, RecvItem, Self::Error>
fn send_one<'a>( self: Pin<&'a mut Self>, item: RecvItem, ) -> SendOne<'a, Self, SendItem, RecvItem, Self::Error>
Send one item. Read more
Source§fn send_iter<'a, I: IntoIterator<Item = RecvItem>>(
self: Pin<&'a mut Self>,
iter: I,
) -> SendIter<'a, Self, SendItem, RecvItem, I::IntoIter, Self::Error>
fn send_iter<'a, I: IntoIterator<Item = RecvItem>>( self: Pin<&'a mut Self>, iter: I, ) -> SendIter<'a, Self, SendItem, RecvItem, I::IntoIter, Self::Error>
Send items from an
IntoIterator. Read moreSource§fn send_try_iter<'a, I: IntoIterator<Item = Result<RecvItem, Self::Error>>>(
self: Pin<&'a mut Self>,
iter: I,
) -> SendTryIter<'a, Self, SendItem, RecvItem, I::IntoIter, Self::Error>
fn send_try_iter<'a, I: IntoIterator<Item = Result<RecvItem, Self::Error>>>( self: Pin<&'a mut Self>, iter: I, ) -> SendTryIter<'a, Self, SendItem, RecvItem, I::IntoIter, Self::Error>
Send items from a fallible
IntoIterator. Read moreSource§fn close<'a>(self: Pin<&'a mut Self>) -> Close<'a, Self, SendItem, RecvItem>
fn close<'a>(self: Pin<&'a mut Self>) -> Close<'a, Self, SendItem, RecvItem>
Closes the
StreamSink. Read moreSource§fn try_send_one<'a, F: FnOnce() -> RecvItem>(
self: Pin<&'a mut Self>,
f: F,
) -> TrySendOne<'a, Self, SendItem, F> ⓘ
fn try_send_one<'a, F: FnOnce() -> RecvItem>( self: Pin<&'a mut Self>, f: F, ) -> TrySendOne<'a, Self, SendItem, F> ⓘ
Try to send an item.
It is safe to drop the
Future before it’s ready.