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.
Trait Implementations§
Source§impl<'de, R> PositionedReader<'de> for Limit<R>where
R: PositionedReader<'de>,
impl<'de, R> PositionedReader<'de> for Limit<R>where
R: PositionedReader<'de>,
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 read_bytes<V>(&mut self, n: usize, visitor: V) -> Result<V::Ok, V::Error>
fn read_bytes<V>(&mut self, n: usize, visitor: V) -> Result<V::Ok, V::Error>
Read a slice out of the current reader.
Source§fn read(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>
fn read(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>
Read a slice into the given buffer.
Source§fn read_array<const N: usize>(&mut self) -> Result<[u8; N], Self::Error>
fn read_array<const N: usize>(&mut self) -> Result<[u8; N], Self::Error>
Read an array out of the current reader.
Source§fn with_position(self) -> WithPosition<Self>where
Self: Sized,
fn with_position(self) -> WithPosition<Self>where
Self: Sized,
Keep an accurate record of the position within the reader.
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