Struct futures_test::sink::TrackClosed
source · [−]pub struct TrackClosed<T> { /* private fields */ }
Expand description
Async wrapper that tracks whether it has been closed.
See the track_closed
methods on:
Implementations
sourceimpl<T> TrackClosed<T>
impl<T> TrackClosed<T>
sourcepub fn get_ref(&self) -> &T
pub fn get_ref(&self) -> &T
Acquires a reference to the underlying object that this adaptor is wrapping.
sourcepub fn get_mut(&mut self) -> &mut T
pub fn get_mut(&mut self) -> &mut T
Acquires a mutable reference to the underlying object that this adaptor is wrapping.
sourcepub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
Acquires a pinned mutable reference to the underlying object that this adaptor is wrapping.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes this adaptor returning the underlying object.
Trait Implementations
sourceimpl<T: AsyncWrite> AsyncWrite for TrackClosed<T>
impl<T: AsyncWrite> AsyncWrite for TrackClosed<T>
sourcefn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
Attempt to write bytes from buf
into the object. Read more
sourcefn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Attempt to flush the object, ensuring that any buffered data reach their destination. Read more
sourceimpl<T: Debug> Debug for TrackClosed<T>
impl<T: Debug> Debug for TrackClosed<T>
sourceimpl<Item, T: Sink<Item>> Sink<Item> for TrackClosed<T>
impl<Item, T: Sink<Item>> Sink<Item> for TrackClosed<T>
sourcefn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>>
fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>>
Attempts to prepare the Sink
to receive a value. Read more
sourcefn start_send(self: Pin<&mut Self>, item: Item) -> Result<(), Self::Error>
fn start_send(self: Pin<&mut Self>, item: Item) -> Result<(), Self::Error>
Begin the process of sending a value to the sink.
Each call to this function must be preceded by a successful call to
poll_ready
which returned Poll::Ready(Ok(()))
. Read more
impl<'pin, T> Unpin for TrackClosed<T> where
__TrackClosed<'pin, T>: Unpin,
Auto Trait Implementations
impl<T> RefUnwindSafe for TrackClosed<T> where
T: RefUnwindSafe,
impl<T> Send for TrackClosed<T> where
T: Send,
impl<T> Sync for TrackClosed<T> where
T: Sync,
impl<T> UnwindSafe for TrackClosed<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
sourcefn flush(&mut self) -> Flush<'_, Self> where
Self: Unpin,
fn flush(&mut self) -> Flush<'_, Self> where
Self: Unpin,
Creates a future which will entirely flush this AsyncWrite
. Read more
sourcefn close(&mut self) -> Close<'_, Self> where
Self: Unpin,
fn close(&mut self) -> Close<'_, Self> where
Self: Unpin,
Creates a future which will entirely close this AsyncWrite
.
sourcefn write(&'a mut self, buf: &'a [u8]) -> Write<'a, Self> where
Self: Unpin,
fn write(&'a mut self, buf: &'a [u8]) -> Write<'a, Self> where
Self: Unpin,
Creates a future which will write bytes from buf
into the object. Read more
sourcefn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectored<'a, Self> where
Self: Unpin,
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectored<'a, Self> where
Self: Unpin,
Creates a future which will write bytes from bufs
into the object using vectored
IO operations. Read more
sourcefn write_all(&'a mut self, buf: &'a [u8]) -> WriteAll<'a, Self> where
Self: Unpin,
fn write_all(&'a mut self, buf: &'a [u8]) -> WriteAll<'a, Self> where
Self: Unpin,
Write data into this object. Read more
sourceimpl<W> AsyncWriteTestExt for W where
W: AsyncWrite,
impl<W> AsyncWriteTestExt for W where
W: AsyncWrite,
sourcefn assert_unmoved_write(self) -> AssertUnmoved<Self>ⓘNotable traits for AssertUnmoved<Fut>impl<Fut: Future> Future for AssertUnmoved<Fut> type Output = Fut::Output;
where
Self: Sized,
fn assert_unmoved_write(self) -> AssertUnmoved<Self>ⓘNotable traits for AssertUnmoved<Fut>impl<Fut: Future> Future for AssertUnmoved<Fut> type Output = Fut::Output;
where
Self: Sized,
Asserts that the given is not moved after being polled. Read more
sourcefn interleave_pending_write(self) -> InterleavePending<Self>ⓘNotable traits for InterleavePending<Fut>impl<Fut: Future> Future for InterleavePending<Fut> type Output = Fut::Output;
where
Self: Sized,
fn interleave_pending_write(self) -> InterleavePending<Self>ⓘNotable traits for InterleavePending<Fut>impl<Fut: Future> Future for InterleavePending<Fut> type Output = Fut::Output;
where
Self: Sized,
Introduces an extra Poll::Pending
in between each operation on the writer. Read more
sourcefn limited_write(self, limit: usize) -> Limited<Self> where
Self: Sized,
fn limited_write(self, limit: usize) -> Limited<Self> where
Self: Sized,
Limit the number of bytes allowed to be written on each call to poll_write
. Read more
sourcefn track_closed(self) -> TrackClosed<Self> where
Self: Sized,
fn track_closed(self) -> TrackClosed<Self> where
Self: Sized,
Track whether this stream has been closed and errors if it is used after closing. Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, Item> SinkExt<Item> for T where
T: Sink<Item> + ?Sized,
impl<T, Item> SinkExt<Item> for T where
T: Sink<Item> + ?Sized,
sourcefn with<U, Fut, F, E>(self, f: F) -> With<Self, Item, U, Fut, F> where
F: FnMut(U) -> Fut,
Fut: Future<Output = Result<Item, E>>,
E: From<Self::Error>,
fn with<U, Fut, F, E>(self, f: F) -> With<Self, Item, U, Fut, F> where
F: FnMut(U) -> Fut,
Fut: Future<Output = Result<Item, E>>,
E: From<Self::Error>,
Composes a function in front of the sink. Read more
sourcefn with_flat_map<U, St, F>(self, f: F) -> WithFlatMap<Self, Item, U, St, F> where
F: FnMut(U) -> St,
St: Stream<Item = Result<Item, Self::Error>>,
fn with_flat_map<U, St, F>(self, f: F) -> WithFlatMap<Self, Item, U, St, F> where
F: FnMut(U) -> St,
St: Stream<Item = Result<Item, Self::Error>>,
Composes a function in front of the sink. Read more
sourcefn sink_map_err<E, F>(self, f: F) -> SinkMapErr<Self, F> where
F: FnOnce(Self::Error) -> E,
fn sink_map_err<E, F>(self, f: F) -> SinkMapErr<Self, F> where
F: FnOnce(Self::Error) -> E,
Transforms the error returned by the sink.
sourcefn sink_err_into<E>(self) -> SinkErrInto<Self, Item, E> where
Self::Error: Into<E>,
fn sink_err_into<E>(self) -> SinkErrInto<Self, Item, E> where
Self::Error: Into<E>,
Map this sink’s error to a different error type using the Into
trait. Read more
sourcefn buffer(self, capacity: usize) -> Buffer<Self, Item>
fn buffer(self, capacity: usize) -> Buffer<Self, Item>
Adds a fixed-size buffer to the current sink. Read more
sourcefn fanout<Si>(self, other: Si) -> Fanout<Self, Si> where
Item: Clone,
Si: Sink<Item, Error = Self::Error>,
fn fanout<Si>(self, other: Si) -> Fanout<Self, Si> where
Item: Clone,
Si: Sink<Item, Error = Self::Error>,
Fanout items to multiple sinks. Read more
sourcefn flush(&mut self) -> Flush<'_, Self, Item> where
Self: Unpin,
fn flush(&mut self) -> Flush<'_, Self, Item> where
Self: Unpin,
Flush the sink, processing all pending items. Read more
sourcefn send(&mut self, item: Item) -> Send<'_, Self, Item> where
Self: Unpin,
fn send(&mut self, item: Item) -> Send<'_, Self, Item> where
Self: Unpin,
A future that completes after the given item has been fully processed into the sink, including flushing. Read more
sourcefn feed(&mut self, item: Item) -> Feed<'_, Self, Item> where
Self: Unpin,
fn feed(&mut self, item: Item) -> Feed<'_, Self, Item> where
Self: Unpin,
A future that completes after the given item has been received by the sink. Read more
sourcefn send_all<St>(&'a mut self, stream: &'a mut St) -> SendAll<'a, Self, St> where
St: TryStream<Ok = Item, Error = Self::Error> + Stream + Unpin + ?Sized,
Self: Unpin,
fn send_all<St>(&'a mut self, stream: &'a mut St) -> SendAll<'a, Self, St> where
St: TryStream<Ok = Item, Error = Self::Error> + Stream + Unpin + ?Sized,
Self: Unpin,
A future that completes after the given stream has been fully processed into the sink, including flushing. Read more
sourcefn left_sink<Si2>(self) -> Either<Self, Si2> where
Si2: Sink<Item, Error = Self::Error>,
fn left_sink<Si2>(self) -> Either<Self, Si2> where
Si2: Sink<Item, Error = Self::Error>,
Wrap this sink in an Either
sink, making it the left-hand variant
of that Either
. Read more
sourcefn right_sink<Si1>(self) -> Either<Si1, Self> where
Si1: Sink<Item, Error = Self::Error>,
fn right_sink<Si1>(self) -> Either<Si1, Self> where
Si1: Sink<Item, Error = Self::Error>,
Wrap this stream in an Either
stream, making it the right-hand variant
of that Either
. Read more
sourcefn poll_ready_unpin(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>> where
Self: Unpin,
fn poll_ready_unpin(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>> where
Self: Unpin,
A convenience method for calling Sink::poll_ready
on Unpin
sink types. Read more
sourcefn start_send_unpin(&mut self, item: Item) -> Result<(), Self::Error> where
Self: Unpin,
fn start_send_unpin(&mut self, item: Item) -> Result<(), Self::Error> where
Self: Unpin,
A convenience method for calling Sink::start_send
on Unpin
sink types. Read more
sourceimpl<Item, W> SinkTestExt<Item> for W where
W: Sink<Item>,
impl<Item, W> SinkTestExt<Item> for W where
W: Sink<Item>,
sourcefn assert_unmoved_sink(self) -> AssertUnmoved<Self>ⓘNotable traits for AssertUnmoved<Fut>impl<Fut: Future> Future for AssertUnmoved<Fut> type Output = Fut::Output;
where
Self: Sized,
fn assert_unmoved_sink(self) -> AssertUnmoved<Self>ⓘNotable traits for AssertUnmoved<Fut>impl<Fut: Future> Future for AssertUnmoved<Fut> type Output = Fut::Output;
where
Self: Sized,
Asserts that the given is not moved after being polled. Read more
sourcefn interleave_pending_sink(self) -> InterleavePending<Self>ⓘNotable traits for InterleavePending<Fut>impl<Fut: Future> Future for InterleavePending<Fut> type Output = Fut::Output;
where
Self: Sized,
fn interleave_pending_sink(self) -> InterleavePending<Self>ⓘNotable traits for InterleavePending<Fut>impl<Fut: Future> Future for InterleavePending<Fut> type Output = Fut::Output;
where
Self: Sized,
Introduces an extra Poll::Pending
in between each operation on the sink. Read more
sourcefn track_closed(self) -> TrackClosed<Self> where
Self: Sized,
fn track_closed(self) -> TrackClosed<Self> where
Self: Sized,
Track whether this sink has been closed and panics if it is used after closing. Read more