pub struct Limit<R> { /* private fields */ }Expand description
Limit the number of bytes that can be read out of a reader to the specified limit.
Constructed through Reader::limit.
Implementations§
Trait Implementations§
Source§impl<'de, R> Reader<'de> for Limit<R>where
R: Reader<'de>,
impl<'de, R> Reader<'de> for Limit<R>where
R: Reader<'de>,
Source§fn borrow_mut(&mut self) -> Self::Mut<'_>
fn borrow_mut(&mut self) -> Self::Mut<'_>
Borrow the current reader.
Source§fn skip<C>(&mut self, cx: C, n: usize) -> Result<(), C::Error>where
C: Context,
fn skip<C>(&mut self, cx: C, n: usize) -> Result<(), C::Error>where
C: Context,
Skip over the given number of bytes.
Source§fn read_bytes<C, V>(
&mut self,
cx: C,
n: usize,
visitor: V,
) -> Result<V::Ok, V::Error>
fn read_bytes<C, V>( &mut self, cx: C, n: usize, visitor: V, ) -> Result<V::Ok, V::Error>
Read a slice out of the current reader.
Source§unsafe fn read_bytes_uninit<C>(
&mut self,
cx: C,
ptr: *mut u8,
n: usize,
) -> Result<(), C::Error>where
C: Context,
unsafe fn read_bytes_uninit<C>(
&mut self,
cx: C,
ptr: *mut u8,
n: usize,
) -> Result<(), C::Error>where
C: Context,
Read into the given buffer which might not have been initialized. Read more
Source§fn read<C>(&mut self, cx: C, buf: &mut [u8]) -> Result<(), C::Error>where
C: Context,
fn read<C>(&mut self, cx: C, buf: &mut [u8]) -> Result<(), C::Error>where
C: Context,
Read a slice into the given buffer.
Source§fn read_byte<C>(&mut self, cx: C) -> Result<u8, C::Error>where
C: Context,
fn read_byte<C>(&mut self, cx: C) -> Result<u8, C::Error>where
C: Context,
Read a single byte.
Auto Trait Implementations§
impl<R> Freeze for Limit<R>where
R: Freeze,
impl<R> RefUnwindSafe for Limit<R>where
R: RefUnwindSafe,
impl<R> Send for Limit<R>where
R: Send,
impl<R> Sync for Limit<R>where
R: Sync,
impl<R> Unpin for Limit<R>where
R: Unpin,
impl<R> UnwindSafe for Limit<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more