pub trait MultipartWriteExt<Part>: MultipartWrite<Part> {
Show 17 methods
// Provided methods
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 flush(&mut self) -> Flush<'_, Self, Part> ⓘ
where Self: Unpin { ... }
fn fold_ret<T, F>(self, id: T, f: F) -> FoldRet<Self, F, T>
where F: FnMut(T, &Self::Ret) -> T,
Self: Sized { ... }
fn map<U, F>(self, f: F) -> Map<Self, F>
where F: FnMut(Self::Output) -> U,
Self: Sized { ... }
fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
where F: FnMut(Self::Error) -> E,
Self: Sized { ... }
fn map_part<U, F>(self, f: F) -> MapPart<Self, F>
where F: FnMut(U) -> Result<Part, Self::Error>,
Self: MultipartWrite<Part> + Sized { ... }
fn map_ret<U, F>(self, f: F) -> MapRet<Self, F>
where F: FnMut(Self::Ret) -> U,
Self: Sized { ... }
fn on_complete<S, F, Fut>(self, s: S, f: F) -> OnComplete<Self, S, F, Fut>
where F: FnMut(&mut S) -> Fut,
Fut: Future<Output = Result<Self, Self::Error>>,
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(&mut self, part: Part) -> Send<'_, Self, Part> ⓘ
where Self: Unpin { ... }
fn then<U, F, Fut>(self, f: F) -> Then<Self, F, Fut>
where F: FnMut(Self::Output) -> Fut,
Fut: Future<Output = U>,
Self: Sized { ... }
fn with<U, Fut, F, E>(self, f: F) -> With<Self, Part, U, 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 MultipartWriters providing a variety of convenient
combinator functions.
Provided Methods§
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 write, 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 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, F, T>
fn fold_ret<T, F>(self, id: T, f: F) -> FoldRet<Self, F, T>
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 map<U, F>(self, f: F) -> Map<Self, F>
fn map<U, F>(self, f: F) -> Map<Self, F>
Map this writer’s output type to a different type, returning a new multipart writer with the given output type.
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_part<U, F>(self, f: F) -> MapPart<Self, F>
fn map_part<U, F>(self, f: F) -> MapPart<Self, F>
Pre-compose the underlying writer with a function that transforms a the input part 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 on_complete<S, F, Fut>(self, s: S, f: F) -> OnComplete<Self, S, F, Fut>
fn on_complete<S, F, Fut>(self, s: S, f: F) -> OnComplete<Self, S, F, Fut>
Returns a writer wrapping this one and having the property that it
creates a new self after each poll_complete.
The value S and closure F determine how this is done.
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 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 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 poll_complete on Unpin writer types.
Sourcefn send(&mut self, part: Part) -> Send<'_, Self, Part> ⓘwhere
Self: Unpin,
fn send(&mut self, part: Part) -> Send<'_, Self, Part> ⓘwhere
Self: Unpin,
A future that completes when a part has been fully processed into the writer, including flushing.
Sourcefn then<U, F, Fut>(self, f: F) -> Then<Self, F, Fut>
fn then<U, F, Fut>(self, f: F) -> Then<Self, F, Fut>
Chain a computation on the output of a writer.
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.