Struct Limited
pub struct Limited<B> { /* private fields */ }
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) -> SelfCreate a new
Limited.
Trait Implementations
impl<'__pin, B> Unpin for Limited<B>
where
PinnedFieldsOf<__Origin<'__pin, B>>: Unpin,
impl<B> Body for Limited<B>
where
B: Body,
B::Error: Into<Box<dyn Error + Send + Sync>>,
type Data = <B as Body>::Data;type Error = Box<dyn Error + Sync + Send>;fn poll_frame(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>>fn is_end_stream(&self) -> boolfn size_hint(&self) -> SizeHint
impl<B: Clone> Clone for Limited<B>
fn clone(&self) -> Limited<B>
impl<B: Copy> Copy for Limited<B>
impl<B: Debug> Debug for Limited<B>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<B> Freeze for Limited<B>
where
B: Freeze,
impl<B> RefUnwindSafe for Limited<B>
where
B: RefUnwindSafe,
impl<B> Send for Limited<B>
where
B: Send,
impl<B> Sync for Limited<B>
where
B: Sync,
impl<B> UnsafeUnpin for Limited<B>
where
B: UnsafeUnpin,
impl<B> UnwindSafe for Limited<B>
where
B: UnwindSafe,
Blanket Implementations
impl<T> Any for Limited<B>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> BodyExt for Limited<B>
where
T: Body + ?Sized,
impl<T> Borrow<T> for Limited<B>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Limited<B>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Limited<B>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Limited<B>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Limited<B>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Limited<B>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Limited<B>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Limited<B>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>