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§type Mut<'this> = &'this mut Limit<R>
where
Limit<R>: 'this
type Mut<'this> = &'this mut Limit<R> where Limit<R>: 'this
Type borrowed from self. Read more
Source§fn skip<C>(&mut self, cx: &mut C, n: usize) -> Result<(), <C as Context>::Error>
fn skip<C>(&mut self, cx: &mut C, n: usize) -> Result<(), <C as Context>::Error>
Skip over the given number of bytes.
Source§fn read_bytes<C, V>(
&mut self,
cx: &mut C,
n: usize,
visitor: V,
) -> Result<<V as ValueVisitor<'de, C, [u8]>>::Ok, <C as Context>::Error>
fn read_bytes<C, V>( &mut self, cx: &mut C, n: usize, visitor: V, ) -> Result<<V as ValueVisitor<'de, C, [u8]>>::Ok, <C as Context>::Error>
Read a slice out of the current reader.
Source§fn peek<C>(&mut self, cx: &mut C) -> Result<Option<u8>, <C as Context>::Error>
fn peek<C>(&mut self, cx: &mut C) -> Result<Option<u8>, <C as Context>::Error>
Peek the next value.
Source§fn read<C>(
&mut self,
cx: &mut C,
buf: &mut [u8],
) -> Result<(), <C as Context>::Error>
fn read<C>( &mut self, cx: &mut C, buf: &mut [u8], ) -> Result<(), <C as Context>::Error>
Read a slice into the given buffer.
Source§fn read_byte<C>(&mut self, cx: &mut C) -> Result<u8, <C as Context>::Error>
fn read_byte<C>(&mut self, cx: &mut C) -> Result<u8, <C as Context>::Error>
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