Skip to main content

MultiAsyncWriter

Struct MultiAsyncWriter 

Source
pub struct MultiAsyncWriter<W: AsyncWrite> { /* private fields */ }
Available on crate feature tokio only.
Expand description

The writer returned by async_writer.

Trait Implementations§

Source§

impl<W: Debug + AsyncWrite> Debug for MultiAsyncWriter<W>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<W: Default + AsyncWrite> Default for MultiAsyncWriter<W>

Source§

fn default() -> MultiAsyncWriter<W>

Returns the “default value” for a type. Read more
Source§

impl<W: AsyncWrite + Default + Unpin> MultipartWrite<&[u8]> for MultiAsyncWriter<W>

Source§

type Error = Error

The type of value returned when an operation fails.
Source§

type Output = W

The type of value assembled from the parts when they have all been written.
Source§

type Recv = usize

The type of value returned when sending a part to be written began successfully.
Source§

fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Attempts to prepare the MultipartWrite to receive a new part. Read more
Source§

fn start_send( self: Pin<&mut Self>, part: &[u8], ) -> Result<Self::Recv, Self::Error>

Begin the process of writing a part to this writer, returning the associated type confirming it was received successfully. Read more
Source§

fn poll_flush( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Flush any remaining output from the writer. Read more
Source§

fn poll_complete( self: Pin<&mut Self>, _cx: &mut Context<'_>, ) -> Poll<Result<Self::Output, Self::Error>>

Complete the write, returning the output assembled from the written parts. Read more
Source§

impl<'__pin, W: AsyncWrite> Unpin for MultiAsyncWriter<W>
where PinnedFieldsOf<__Origin<'__pin, W>>: Unpin,

Auto Trait Implementations§

§

impl<W> Freeze for MultiAsyncWriter<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for MultiAsyncWriter<W>
where W: RefUnwindSafe,

§

impl<W> Send for MultiAsyncWriter<W>
where W: Send,

§

impl<W> Sync for MultiAsyncWriter<W>
where W: Sync,

§

impl<W> UnsafeUnpin for MultiAsyncWriter<W>
where W: UnsafeUnpin,

§

impl<W> UnwindSafe for MultiAsyncWriter<W>
where W: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Wr, Part> MultipartWriteExt<Part> for Wr
where Wr: MultipartWrite<Part>,

Source§

fn boxed<'a>( self, ) -> BoxMultipartWrite<'a, Part, Self::Recv, Self::Output, Self::Error>
where Self: Sized + Send + 'a,

Wrap this writer in a Box, pinning it.
Source§

fn box_fused<'a>( self, ) -> BoxFusedMultipartWrite<'a, Part, Self::Recv, Self::Output, Self::Error>
where Self: Sized + Send + FusedMultipartWrite<Part> + 'a,

Wrap this writer, which additionally has conditions making it a FusedMultipartWrite, in a Box, pinning it.
Source§

fn box_fused_local<'a>( self, ) -> LocalBoxFusedMultipartWrite<'a, Part, Self::Recv, Self::Output, Self::Error>
where Self: Sized + FusedMultipartWrite<Part> + 'a,

Wrap this writer, which additionally has conditions making it a FusedMultipartWrite, in a Box, pinning it. Read more
Source§

fn boxed_local<'a>( self, ) -> LocalBoxMultipartWrite<'a, Part, Self::Recv, Self::Output, Self::Error>
where Self: Sized + 'a,

Wrap this writer in a Box, pinning it. Read more
Source§

fn buffered(self, capacity: impl Into<Option<usize>>) -> Buffered<Self, Part>
where Self: Sized,

Adds a fixed size buffer to the current writer. Read more
Source§

fn complete(&mut self) -> Complete<'_, Self, Part>
where Self: Unpin,

A future that runs this writer to completion, returning the associated output.
Source§

fn fanout<U>(self, other: U) -> Fanout<Self, U, Part>
where Part: Clone, U: MultipartWrite<Part, Error = Self::Error>, Self: Sized,

Fanout the part to multiple writers. Read more
Source§

fn feed(&mut self, part: Part) -> Feed<'_, Self, Part>
where Self: Unpin,

A future that completes after the given part has been received by the writer. Read more
Source§

fn filter_part<F>(self, f: F) -> FilterPart<Self, Part, F>
where F: FnMut(&Part) -> bool, Self: Sized,

Apply a filter to this writer’s parts, returning a new writer with the same output. Read more
Source§

fn filter_map_part<P, F>(self, f: F) -> FilterMapPart<Self, Part, P, F>
where F: FnMut(P) -> Option<Part>, Self: Sized,

Attempt to map the input to a part for this writer, filtering out the inputs where the mapping returns None. Read more
Source§

fn flush(&mut self) -> Flush<'_, Self, Part>
where Self: Unpin,

A future that completes when the underlying writer has been flushed.
Source§

fn fold_sent<T, F>(self, id: T, f: F) -> FoldSent<Self, T, F, Part>
where F: FnMut(T, &Self::Recv) -> T, Self: Sized,

Accumulate the values returned by starting a send, returning it with the output. Read more
Source§

fn for_each_recv<Fut, F>(self, f: F) -> ForEachRecv<Self, Part, Fut, F>
where Self: Sized, Self::Recv: Clone, F: FnMut(Self::Recv) -> Fut, Fut: Future<Output = ()>,

Evaluate the given async closure on the associated Self::Recv for this writer. Read more
Source§

fn fuse<F>(self, f: F) -> Fuse<Self, Part, F>
where F: FnMut(&Self::Output) -> bool, Self: Sized,

Returns a new writer that fuses according to the provided closure. Read more
Source§

fn lift<U, P>(self, other: U) -> Lift<Self, U, P, Part>
where Self: Sized, Self::Error: From<U::Error>, U: MultipartWrite<P, Output = Part>,

Produce the parts for this writer from the output of another writer. Read more
Source§

fn map_sent<R, F>(self, f: F) -> MapSent<Self, Part, R, F>
where F: FnMut(Self::Recv) -> R, Self: Sized,

Map this writer’s return type to a different value, returning a new multipart writer with the given return type. Read more
Source§

fn map_err<E, F>(self, f: F) -> MapErr<Self, Part, E, F>
where F: FnMut(Self::Error) -> E, Self: Sized,

Map this writer’s error type to a different value, returning a new multipart writer with the given error type.
Source§

fn map_ok<T, F>(self, f: F) -> MapOk<Self, Part, T, F>
where F: FnMut(Self::Output) -> T, Self: Sized,

Map this writer’s output type to a different type, returning a new multipart writer with the given output type.
Source§

fn poll_ready_unpin( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
where Self: Unpin,

A convenience method for calling MultipartWrite::poll_ready on Unpin writer types.
Source§

fn poll_flush_unpin( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
where Self: Unpin,

A convenience method for calling MultipartWrite::poll_flush on Unpin writer types.
Source§

fn poll_complete_unpin( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Self::Output, Self::Error>>
where Self: Unpin,

A convenience method for calling MultipartWrite::poll_complete on Unpin writer types.
Source§

fn ready_part<P, Fut, F>(self, f: F) -> ReadyPart<Self, Part, P, Fut, F>
where F: FnMut(P) -> Fut, Fut: Future<Output = Result<Part, Self::Error>>, Self: Sized,

Provide a part to this writer in the output of a future. Read more
Source§

fn send_flush(&mut self, part: Part) -> SendFlush<'_, Self, Part>
where Self: Unpin,

A future that completes when a part has been fully processed into the writer, including flushing.
Source§

fn then<T, Fut, F>(self, f: F) -> Then<Self, Part, T, Fut, F>
where F: FnMut(Result<Self::Output, Self::Error>) -> Fut, Fut: Future<Output = Result<T, Self::Error>>, Self: Sized,

Asynchronously map the result of completing this writer to a different result. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.