pub struct TrackClosed<T> { /* private fields */ }
Expand description
Async wrapper that tracks whether it has been closed.
See the track_closed
methods on:
Implementations§
Source§impl<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>
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T>
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§
Source§impl<T: AsyncWrite> AsyncWrite for TrackClosed<T>
impl<T: AsyncWrite> AsyncWrite for TrackClosed<T>
Source§fn 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 moreSource§fn 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
Source§impl<T: Debug> Debug for TrackClosed<T>
impl<T: Debug> Debug for TrackClosed<T>
Source§impl<Item, T: Sink<Item>> Sink<Item> for TrackClosed<T>
impl<Item, T: Sink<Item>> Sink<Item> for TrackClosed<T>
Source§type Error = <T as Sink<Item>>::Error
type Error = <T as Sink<Item>>::Error
The type of value produced by the sink when an error occurs.
Source§fn 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 moreSource§fn 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 moreimpl<'pin, T> Unpin for TrackClosed<T>where
__TrackClosed<'pin, T>: Unpin,
Auto Trait Implementations§
impl<T> Freeze for TrackClosed<T>where
T: Freeze,
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§
§impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
§fn 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§fn 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
.§fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self> ⓘwhere
Self: Unpin,
fn write<'a>(&'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§fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>],
) -> WriteVectored<'a, Self> ⓘwhere
Self: Unpin,
fn write_vectored<'a>(
&'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 moreSource§impl<W> AsyncWriteTestExt for Wwhere
W: AsyncWrite,
impl<W> AsyncWriteTestExt for Wwhere
W: AsyncWrite,
Source§fn assert_unmoved_write(self) -> AssertUnmoved<Self> ⓘwhere
Self: Sized,
fn assert_unmoved_write(self) -> AssertUnmoved<Self> ⓘwhere
Self: Sized,
Asserts that the given is not moved after being polled. Read more
Source§fn interleave_pending_write(self) -> InterleavePending<Self> ⓘwhere
Self: Sized,
fn interleave_pending_write(self) -> InterleavePending<Self> ⓘwhere
Self: Sized,
Introduces an extra
Poll::Pending
in between each operation on the writer. Read moreSource§fn 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 moreSource§fn 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
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
§impl<T, Item> SinkExt<Item> for T
impl<T, Item> SinkExt<Item> for T
§fn with<U, Fut, F, E>(self, f: F) -> With<Self, Item, U, Fut, F>
fn with<U, Fut, F, E>(self, f: F) -> With<Self, Item, U, Fut, F>
Composes a function in front of the sink. Read more
§fn with_flat_map<U, St, F>(self, f: F) -> WithFlatMap<Self, Item, U, St, F>
fn with_flat_map<U, St, F>(self, f: F) -> WithFlatMap<Self, Item, U, St, F>
Composes a function in front of the sink. Read more
§fn sink_map_err<E, F>(self, f: F) -> SinkMapErr<Self, F>
fn sink_map_err<E, F>(self, f: F) -> SinkMapErr<Self, F>
Transforms the error returned by the sink.
§fn sink_err_into<E>(self) -> SinkErrInto<Self, Item, E>
fn sink_err_into<E>(self) -> SinkErrInto<Self, Item, E>
Map this sink’s error to a different error type using the
Into
trait. Read more§fn buffer(self, capacity: usize) -> Buffer<Self, Item>where
Self: Sized,
fn buffer(self, capacity: usize) -> Buffer<Self, Item>where
Self: Sized,
Adds a fixed-size buffer to the current sink. Read more
§fn 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
§fn 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
§fn 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
§fn send_all<'a, St>(&'a mut self, stream: &'a mut St) -> SendAll<'a, Self, St> ⓘ
fn send_all<'a, St>(&'a mut self, stream: &'a mut St) -> SendAll<'a, Self, St> ⓘ
A future that completes after the given stream has been fully processed
into the sink, including flushing. Read more
§fn right_sink<Si1>(self) -> Either<Si1, Self> ⓘ
fn right_sink<Si1>(self) -> Either<Si1, Self> ⓘ
§fn 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.§fn 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.§fn poll_flush_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>where
Self: Unpin,
fn poll_flush_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>where
Self: Unpin,
A convenience method for calling
Sink::poll_flush
on Unpin
sink types.§fn poll_close_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>where
Self: Unpin,
fn poll_close_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>where
Self: Unpin,
A convenience method for calling
Sink::poll_close
on Unpin
sink types.Source§impl<Item, W> SinkTestExt<Item> for Wwhere
W: Sink<Item>,
impl<Item, W> SinkTestExt<Item> for Wwhere
W: Sink<Item>,
Source§fn assert_unmoved_sink(self) -> AssertUnmoved<Self> ⓘwhere
Self: Sized,
fn assert_unmoved_sink(self) -> AssertUnmoved<Self> ⓘwhere
Self: Sized,
Asserts that the given is not moved after being polled. Read more
Source§fn interleave_pending_sink(self) -> InterleavePending<Self> ⓘwhere
Self: Sized,
fn interleave_pending_sink(self) -> InterleavePending<Self> ⓘwhere
Self: Sized,
Introduces an extra
Poll::Pending
in between each operation on the sink.Source§fn 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