MapErr

Struct MapErr 

Source
pub struct MapErr<Wr, F> { /* private fields */ }
Expand description

MultipartWrite for map_err.

Implementations§

Source§

impl<Wr, F> MapErr<Wr, F>

Source

pub fn into_inner(self) -> Wr

Consumes MapErr, returning the underlying writer.

Source

pub fn get_ref(&self) -> &Wr

Acquires a reference to the underlying writer.

Source

pub fn get_mut(&mut self) -> &mut Wr

Acquires a mutable reference to the underlying writer.

It is inadvisable to directly write to the underlying writer.

Source

pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut Wr>

Acquires a pinned mutable reference to the underlying writer.

It is inadvisable to directly write to the underlying writer.

Trait Implementations§

Source§

impl<Wr: Debug, F> Debug for MapErr<Wr, F>

Source§

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

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

impl<Wr, F, Part, E> FusedMultipartWrite<Part> for MapErr<Wr, F>
where Wr: FusedMultipartWrite<Part>, F: FnMut(Wr::Error) -> E,

Source§

fn is_terminated(&self) -> bool

Returns true if the writer should no longer be polled.
Source§

impl<Wr, F, Part, E> MultipartWrite<Part> for MapErr<Wr, F>
where Wr: MultipartWrite<Part>, F: FnMut(Wr::Error) -> E,

Source§

type Ret = <Wr as MultipartWrite<Part>>::Ret

The type of value returned when writing the part began successfully.
Source§

type Output = <Wr as MultipartWrite<Part>>::Output

The type of value returned when all parts are written.
Source§

type Error = E

The type of value returned when an operation fails.
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: Part, ) -> Result<Self::Ret, Self::Error>

Begin the process of writing a part to this writer, returning the associated type confirming this was done 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 this writer, returning the output. Read more
Source§

impl<'__pin, Wr, F> Unpin for MapErr<Wr, F>
where PinnedFieldsOf<__Origin<'__pin, Wr, F>>: Unpin,

Auto Trait Implementations§

§

impl<Wr, F> Freeze for MapErr<Wr, F>
where Wr: Freeze, F: Freeze,

§

impl<Wr, F> RefUnwindSafe for MapErr<Wr, F>

§

impl<Wr, F> Send for MapErr<Wr, F>
where Wr: Send, F: Send,

§

impl<Wr, F> Sync for MapErr<Wr, F>
where Wr: Sync, F: Sync,

§

impl<Wr, F> UnwindSafe for MapErr<Wr, F>
where Wr: UnwindSafe, F: 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 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,

Compute from this writer’s output type a new output of a different type using an asynchronous closure. Read more
Source§

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

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

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. 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<F>(self, f: F) -> Filter<Self, 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<U, F>(self, f: F) -> FilterMap<Self, F>
where F: FnMut(U) -> 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_ret<T, F>(self, id: T, f: F) -> FoldRet<Self, T, F>
where F: FnMut(T, &Self::Ret) -> T, Self: Sized,

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.
Source§

fn fuse<F>(self, f: F) -> Fuse<Self, 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, T>(self, other: U) -> Lift<Self, U, Part>
where Self: Sized, Self::Error: From<U::Error>, U: MultipartWrite<T, Output = Part>,

“Lift” the multipart writer U in front of this one. Read more
Source§

fn map_err<E, F>(self, f: F) -> MapErr<Self, 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<U, F>(self, f: F) -> MapOk<Self, F>
where F: FnMut(Self::Output) -> U, Self: Sized,

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

fn map_ret<U, F>(self, f: F) -> MapRet<Self, F>
where F: FnMut(Self::Ret) -> U, Self: Sized,

Map this writer’s return type to a different value, returning a new multipart writer with the given return 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 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.
Source§

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,

Chain an asynchronous computation on the result of polling the writer for completion.
Source§

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,

Provide a part to this writer in the output of a future. 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.