Struct Limited

struct Limited<B> { ... }

A length limited body.

This body will return an error if more than the configured number of bytes are returned on polling the wrapped body.

Implementations

impl<B> Limited<B>

fn new(inner: B, limit: usize) -> Self

Create a new Limited.

impl<'__pin, B> Unpin for Limited<B>

impl<B> Body for Limited<B>

fn poll_frame(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Result<Frame<<Self as >::Data>, <Self as >::Error>>>
fn is_end_stream(self: &Self) -> bool
fn size_hint(self: &Self) -> SizeHint

impl<B> Freeze for Limited<B>

impl<B> RefUnwindSafe for Limited<B>

impl<B> Send for Limited<B>

impl<B> Sync for Limited<B>

impl<B> UnsafeUnpin for Limited<B>

impl<B> UnwindSafe for Limited<B>

impl<B: $crate::clone::Clone> Clone for Limited<B>

fn clone(self: &Self) -> Limited<B>

impl<B: $crate::fmt::Debug> Debug for Limited<B>

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

impl<B: $crate::marker::Copy> Copy for Limited<B>

impl<T> Any for Limited<B>

fn type_id(self: &Self) -> TypeId

impl<T> BodyExt for Limited<B>

impl<T> Borrow for Limited<B>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Limited<B>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Limited<B>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Limited<B>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Limited<B>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Limited<B>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Limited<B>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Limited<B>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>