# http_body::combinators::MapErr - Rust
API documentation for the Rust `MapErr` struct in crate `http_body`.
Keywords: rust, rustlang, rust-lang, MapErr

# [−] [src] Struct http_body::combinators::MapErr

    pub struct MapErr<B, F> { /* fields omitted */ }

Body returned by the `map_err` combinator.

## Implementations

### `impl<B, F> MapErr<B, F>` [src]

#### `pub fn get_ref(&self) -> &B` [src]

Get a reference to the inner body

#### `pub fn get_mut(&mut self) -> &mut B` [src]

Get a mutable reference to the inner body

#### `pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut B>` [src]

Get a pinned mutable reference to the inner body

#### `pub fn into_inner(self) -> B` [src]

Consume `self`, returning the inner body

## Trait Implementations

### `impl<B, F, E> Body for MapErr<B, F> where
B: Body,
F: FnMut(B::Error) -> E,` [src]

#### `type Data = B::Data`

Values yielded by the `Body`.

#### `type Error = E`

The error type this `Body` might generate.

#### `fn poll_data(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Self::Data, Self::Error>>>` [src]

Attempt to pull out the next data buffer of this stream.

#### `fn poll_trailers(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<Option<HeaderMap>, Self::Error>>` [src]

Poll for an optional single `HeaderMap` of trailers. Read more

#### `fn is_end_stream(&self) -> bool` [src]

Returns `true` when the end of stream has been reached. Read more

#### `fn size_hint(&self) -> SizeHint` [src]

Returns the bounds on the remaining length of the stream. Read more

#### `fn data(&mut self) -> Data<'_, Self>ⓘ

### Notable traits for Data<'a, T>

`impl<'a, T: Body + Unpin + ?Sized> Future for Data<'a, T> type Output = Option<Result<T::Data, T::Error>>;`
where
Self: Unpin + Sized,` [src]

Returns future that resolves to next data chunk, if any.

#### `fn trailers(&mut self) -> Trailers<'_, Self>ⓘ

### Notable traits for Trailers<'a, T>

`impl<'a, T: Body + Unpin + ?Sized> Future for Trailers<'a, T> type Output = Result<Option<HeaderMap>, T::Error>;`
where
Self: Unpin + Sized,` [src]

Returns future that resolves to trailers, if any.

#### `fn map_data<F, B>(self, f: F) -> MapData<Self, F> where
Self: Sized,
F: FnMut(Self::Data) -> B,
B: Buf,` [src]

Maps this body's data value to a different value.

#### `fn map_err<F, E>(self, f: F) -> MapErr<Self, F> where
Self: Sized,
F: FnMut(Self::Error) -> E,` [src]

Maps this body's error value to a different value.

#### `fn boxed(self) -> BoxBody<Self::Data, Self::Error> where
Self: Sized + Send + Sync + 'static,` [src]

Turn this body into a boxed trait object.

### `impl<B: Clone, F: Clone> Clone for MapErr<B, F>` [src]

#### `fn clone(&self) -> MapErr<B, F>` [src]

Returns a copy of the value. Read more

#### `pub fn clone_from(&mut self, source: &Self)`1.0.0 [src]

Performs copy-assignment from `source`. Read more

### `impl<B: Copy, F: Copy> Copy for MapErr<B, F>` [src]

### `impl<B: Debug, F: Debug> Debug for MapErr<B, F>` [src]

#### `fn fmt(&self, f: &mut Formatter<'_>) -> Result` [src]

Formats the value using the given formatter. Read more

### `impl<'__pin, B, F> Unpin for MapErr<B, F> where
__Origin<'__pin, B, F>: Unpin,` [src]

## Auto Trait Implementations

### `impl<B, F> RefUnwindSafe for MapErr<B, F> where
B: RefUnwindSafe,
F: RefUnwindSafe,` [src]

### `impl<B, F> Send for MapErr<B, F> where
B: Send,
F: Send,` [src]

### `impl<B, F> Sync for MapErr<B, F> where
B: Sync,
F: Sync,` [src]

### `impl<B, F> UnwindSafe for MapErr<B, F> where
B: UnwindSafe,
F: UnwindSafe,` [src]

## Blanket Implementations

### `impl<T> Any for T where
T: 'static + ?Sized,` [src]

#### `pub fn type_id(&self) -> TypeId` [src]

Gets the `TypeId` of `self`. Read more

### `impl<T> Borrow<T> for T where
T: ?Sized,` [src]

#### `pub fn borrow(&self) -> &T` [src]

Immutably borrows from an owned value. Read more

### `impl<T> BorrowMut<T> for T where
T: ?Sized,` [src]

#### `pub fn borrow_mut(&mut self) -> &mut T` [src]

Mutably borrows from an owned value. Read more

### `impl<T> From<T> for T` [src]

#### `pub fn from(t: T) -> T` [src]

Performs the conversion.

### `impl<T, U> Into<U> for T where
U: From<T>,` [src]

#### `pub fn into(self) -> U` [src]

Performs the conversion.

### `impl<T> ToOwned for T where
T: Clone,` [src]

#### `type Owned = T`

The resulting type after obtaining ownership.

#### `pub fn to_owned(&self) -> T` [src]

Creates owned data from borrowed data, usually by cloning. Read more

#### `pub fn clone_into(&self, target: &mut T)` [src]

🔬 This is a nightly-only experimental API. (`toowned_clone_into`)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

### `impl<T, U> TryFrom<U> for T where
U: Into<T>,` [src]

#### `type Error = Infallible`

The type returned in the event of a conversion error.

#### `pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>` [src]

Performs the conversion.

### `impl<T, U> TryInto<U> for T where
U: TryFrom<T>,` [src]

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

The type returned in the event of a conversion error.

#### `pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>` [src]

Performs the conversion.