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§
source§impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
source§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 moresource§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
.source§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 moresource§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
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