pub struct Bytes<'i> { /* private fields */ }Expand description
Implementations§
Source§impl<'i> Bytes<'i>
impl<'i> Bytes<'i>
Sourcepub fn parse<P: Pattern>(&mut self, pattern: P) -> Option<&'i [u8]>
pub fn parse<P: Pattern>(&mut self, pattern: P) -> Option<&'i [u8]>
Tests the pattern against the slice of bytes begining at the cursor.
If the pattern matches, the cursor is moved, and the corresponding bytes are returned.
Trait Implementations§
Source§impl Seek for Bytes<'_>
impl Seek for Bytes<'_>
Source§fn seek(&mut self, pos: SeekFrom) -> Result<u64>
fn seek(&mut self, pos: SeekFrom) -> Result<u64>
Seek to an offset, in bytes, in a stream. Read more
1.55.0 · Source§fn rewind(&mut self) -> Result<(), Error>
fn rewind(&mut self) -> Result<(), Error>
Rewind to the beginning of a stream. Read more
Source§fn stream_len(&mut self) -> Result<u64, Error>
fn stream_len(&mut self) -> Result<u64, Error>
🔬This is a nightly-only experimental API. (
seek_stream_len)Returns the length of this stream (in bytes). Read more
impl<'i> Copy for Bytes<'i>
impl<'i> Eq for Bytes<'i>
impl<'i> StructuralPartialEq for Bytes<'i>
Auto Trait Implementations§
impl<'i> Freeze for Bytes<'i>
impl<'i> RefUnwindSafe for Bytes<'i>
impl<'i> Send for Bytes<'i>
impl<'i> Sync for Bytes<'i>
impl<'i> Unpin for Bytes<'i>
impl<'i> UnwindSafe for Bytes<'i>
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