pub trait MultipartWriteExt<Part>: MultipartWrite<Part> {
Show 19 methods
// Provided methods
fn bootstrapped<S, F, Fut>(
self,
s: S,
f: F,
) -> Bootstrapped<Self, S, F, Fut>
where F: FnMut(&mut S) -> Fut,
Fut: Future<Output = Result<Option<Self>, 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 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 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<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 bootstrapped<S, F, Fut>(self, s: S, f: F) -> Bootstrapped<Self, S, F, Fut>
fn bootstrapped<S, F, Fut>(self, s: S, f: F) -> Bootstrapped<Self, S, F, Fut>
Returns a writer wrapping this one and having the property that a call to
poll_ready will create Self if missing.
The value S and closure F determine how this is done. If a multipart
write is not left in a reusable state after poll_complete, this adapter
can be used to make a writer more than one-time-use where it otherwise
would not be.
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 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 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_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<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.