pub trait MultipartWriteExt<Part>: MultipartWrite<Part> {
Show 22 methods
// Provided methods
fn and_then<T, E, Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
where F: FnMut(Self::Output) -> Fut,
Fut: Future<Output = Result<T, E>>,
E: From<Self::Error>,
Self: Sized { ... }
fn boxed<'a>(
self,
) -> BoxMultipartWrite<'a, Part, Self::Ret, Self::Output, Self::Error>
where Self: Sized + Send + 'a { ... }
fn boxed_local<'a>(
self,
) -> LocalBoxMultipartWrite<'a, Part, Self::Ret, Self::Output, Self::Error>
where Self: Sized + 'a { ... }
fn buffered(
self,
capacity: impl Into<Option<usize>>,
) -> Buffered<Self, Part>
where Self: Sized { ... }
fn complete(&mut self) -> Complete<'_, Self, Part> ⓘ
where Self: Unpin { ... }
fn fanout<U>(self, other: U) -> Fanout<Self, U, Part>
where Part: Clone,
U: MultipartWrite<Part, Error = Self::Error>,
Self: Sized { ... }
fn feed(&mut self, part: Part) -> Feed<'_, Self, Part> ⓘ
where Self: Unpin { ... }
fn filter<F>(self, f: F) -> Filter<Self, F>
where F: FnMut(&Part) -> bool,
Self: Sized { ... }
fn filter_map<U, F>(self, f: F) -> FilterMap<Self, F>
where F: FnMut(U) -> Option<Part>,
Self: Sized { ... }
fn flush(&mut self) -> Flush<'_, Self, Part> ⓘ
where Self: Unpin { ... }
fn fold_ret<T, F>(self, id: T, f: F) -> FoldRet<Self, T, F>
where F: FnMut(T, &Self::Ret) -> T,
Self: Sized { ... }
fn fuse<F>(self, f: F) -> Fuse<Self, F>
where F: FnMut(&Self::Output) -> bool,
Self: Sized { ... }
fn lift<U, T>(self, other: U) -> Lift<Self, U, Part>
where Self: Sized,
Self::Error: From<U::Error>,
U: MultipartWrite<T, Output = Part> { ... }
fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
where F: FnMut(Self::Error) -> E,
Self: Sized { ... }
fn map_ok<U, F>(self, f: F) -> MapOk<Self, F>
where F: FnMut(Self::Output) -> U,
Self: Sized { ... }
fn map_ret<U, F>(self, f: F) -> MapRet<Self, F>
where F: FnMut(Self::Ret) -> U,
Self: Sized { ... }
fn poll_ready_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 { ... }
fn poll_complete_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Self::Output, Self::Error>>
where Self: Unpin { ... }
fn send_part(&mut self, part: Part) -> SendPart<'_, Self, Part> ⓘ
where Self: Unpin { ... }
fn then<T, E, Fut, F>(self, f: F) -> Then<Self, Fut, F>
where F: FnMut(Result<Self::Output, Self::Error>) -> Fut,
Fut: Future<Output = Result<T, E>>,
E: From<Self::Error>,
Self: Sized { ... }
fn with<U, E, Fut, F>(self, f: F) -> With<Self, Part, Fut, F>
where F: FnMut(U) -> Fut,
Fut: Future<Output = Result<Part, E>>,
E: From<Self::Error>,
Self: Sized { ... }
}Expand description
An extension trait for MultipartWrite providing a variety of convenient
combinator functions.
Provided Methods§
Sourcefn and_then<T, E, Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
fn and_then<T, E, Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
Compute from this writer’s output type a new output of a different type using an asynchronous closure.
Calling poll_complete on this writer will complete the inner writer,
then run the provided closure f with the output to produce the final
output of this writer.
Sourcefn boxed<'a>(
self,
) -> BoxMultipartWrite<'a, Part, Self::Ret, Self::Output, Self::Error>
fn boxed<'a>( self, ) -> BoxMultipartWrite<'a, Part, Self::Ret, Self::Output, Self::Error>
Wrap this writer in a Box, pinning it.
Sourcefn boxed_local<'a>(
self,
) -> LocalBoxMultipartWrite<'a, Part, Self::Ret, Self::Output, Self::Error>where
Self: Sized + 'a,
fn boxed_local<'a>(
self,
) -> LocalBoxMultipartWrite<'a, Part, Self::Ret, Self::Output, Self::Error>where
Self: Sized + 'a,
Wrap this writer in a Box, pinning it.
Similar to boxed but without the Send requirement.
Sourcefn buffered(self, capacity: impl Into<Option<usize>>) -> Buffered<Self, Part>where
Self: Sized,
fn buffered(self, capacity: impl Into<Option<usize>>) -> Buffered<Self, Part>where
Self: Sized,
Adds a fixed size buffer to the current writer.
The resulting MultipartWrite will buffer up to capacity items when
the underlying writer is not able to accept new parts.
Sourcefn complete(&mut self) -> Complete<'_, Self, Part> ⓘwhere
Self: Unpin,
fn complete(&mut self) -> Complete<'_, Self, Part> ⓘwhere
Self: Unpin,
A future that runs this writer to completion, returning the associated output.
Sourcefn fanout<U>(self, other: U) -> Fanout<Self, U, Part>
fn fanout<U>(self, other: U) -> Fanout<Self, U, Part>
Fanout the part to multiple writers.
This adapter clones each incoming part and forwards it to both writers.
Sourcefn feed(&mut self, part: Part) -> Feed<'_, Self, Part> ⓘwhere
Self: Unpin,
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.
Unlike send_part, the returned future does not flush the writer. It is
the caller’s responsibility to ensure all pending items are processed,
which can be done with flush or complete.
Sourcefn filter<F>(self, f: F) -> Filter<Self, F>
fn filter<F>(self, f: F) -> Filter<Self, F>
Apply a filter to this writer’s parts, returning a new writer with the same output.
The return type of this writer is Option<Self::Ret> and is None when
the part did not pass the filter.
Sourcefn filter_map<U, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<U, F>(self, f: F) -> FilterMap<Self, F>
Attempt to map the input to a part for this writer, filtering out the
inputs where the mapping returns None.
The return type of this writer is Option<Self::Ret> and is None when
the mapping of the input U did not pass the filter.
Sourcefn flush(&mut self) -> Flush<'_, Self, Part> ⓘwhere
Self: Unpin,
fn flush(&mut self) -> Flush<'_, Self, Part> ⓘwhere
Self: Unpin,
A future that completes when the underlying writer has been flushed.
Sourcefn fold_ret<T, F>(self, id: T, f: F) -> FoldRet<Self, T, F>
fn fold_ret<T, F>(self, id: T, f: F) -> FoldRet<Self, T, F>
Accumulate this writer’s returned values, returning a new multipart writer that pairs the underlying writer’s output with the result of the accumulating function.
Sourcefn fuse<F>(self, f: F) -> Fuse<Self, F>
fn fuse<F>(self, f: F) -> Fuse<Self, F>
Returns a new writer that fuses according to the provided closure.
The resulting writer wraps both Self::Ret and Self::Output in an
Option and is guaranted to both output and return Ok(None) when
called after becoming fused.
Sourcefn lift<U, T>(self, other: U) -> Lift<Self, U, Part>
fn lift<U, T>(self, other: U) -> Lift<Self, U, Part>
“Lift” the multipart writer U in front of this one.
The result is a new multipart writer that writes parts for U, using the
output of U to source the parts to write to this writer, and resolving
to the output of this writer when polled to completion.
In other words, it expresses this multipart writer as being built from the parts of another multipart writer.
Sourcefn map_err<E, F>(self, f: F) -> MapErr<Self, F>
fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
Map this writer’s error type to a different value, returning a new multipart writer with the given error type.
Sourcefn map_ok<U, F>(self, f: F) -> MapOk<Self, F>
fn map_ok<U, F>(self, f: F) -> MapOk<Self, F>
Map this writer’s output type to a different type, returning a new multipart writer with the given output type.
Sourcefn map_ret<U, F>(self, f: F) -> MapRet<Self, F>
fn map_ret<U, F>(self, f: F) -> MapRet<Self, F>
Map this writer’s return type to a different value, returning a new multipart writer with the given return type.
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 MultipartWrite::poll_ready on
Unpin writer types.
Sourcefn 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 MultipartWrite::poll_flush on
Unpin writer types.
Sourcefn poll_complete_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Self::Output, Self::Error>>where
Self: Unpin,
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.
Sourcefn send_part(&mut self, part: Part) -> SendPart<'_, Self, Part> ⓘwhere
Self: Unpin,
fn send_part(&mut self, part: Part) -> SendPart<'_, Self, Part> ⓘwhere
Self: Unpin,
A future that completes when a part has been fully processed into the writer, including flushing.
Sourcefn then<T, E, Fut, F>(self, f: F) -> Then<Self, Fut, F>
fn then<T, E, Fut, F>(self, f: F) -> Then<Self, Fut, F>
Chain an asynchronous computation on the result of polling the writer for completion.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.