pub struct AsyncWriteStream<S> { /* private fields */ }Available on crate features
io and compat only.Expand description
A write stream wrapper for [futures_util::io].
It doesn’t support read operations, making looser requirements on the inner stream.
Implementations§
Source§impl<S> AsyncWriteStream<S>
impl<S> AsyncWriteStream<S>
Sourcepub fn new(stream: S) -> AsyncWriteStream<S>
pub fn new(stream: S) -> AsyncWriteStream<S>
Create AsyncWriteStream with the stream and default buffer size.
Sourcepub fn with_capacity(cap: usize, stream: S) -> AsyncWriteStream<S>
pub fn with_capacity(cap: usize, stream: S) -> AsyncWriteStream<S>
Create AsyncWriteStream with the stream and buffer size.
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Consumes the SyncStream, returning the underlying stream.
Trait Implementations§
Source§impl<S> AsyncWrite for AsyncWriteStream<S>where
S: AsyncWrite + Unpin + 'static,
impl<S> AsyncWrite for AsyncWriteStream<S>where
S: AsyncWrite + Unpin + 'static,
Source§fn poll_write(
self: Pin<&mut AsyncWriteStream<S>>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, Error>>
fn poll_write( self: Pin<&mut AsyncWriteStream<S>>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Error>>
Attempt to write bytes from
buf into the object. Read moreSource§fn poll_flush(
self: Pin<&mut AsyncWriteStream<S>>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Error>>
fn poll_flush( self: Pin<&mut AsyncWriteStream<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), Error>>
Attempt to flush the object, ensuring that any buffered data reach
their destination. Read more
impl<'__pin, S> Unpin for AsyncWriteStream<S>where
<PinnedFieldsOfHelperStruct<__Origin<'__pin, S>> as PinnedFieldsOfHelperTrait>::Actual: Unpin,
Auto Trait Implementations§
impl<S> Freeze for AsyncWriteStream<S>where
S: Freeze,
impl<S> !RefUnwindSafe for AsyncWriteStream<S>
impl<S> !Send for AsyncWriteStream<S>
impl<S> !Sync for AsyncWriteStream<S>
impl<S> !UnsafeUnpin for AsyncWriteStream<S>
impl<S> !UnwindSafe for AsyncWriteStream<S>
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<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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more