Peeker

Struct Peeker 

Source
pub struct Peeker<B: ?Sized> { /* private fields */ }
Expand description

A peeker for reading from a buffer without advancing the original buffer’s cursor.

Peeker provides a non-destructive way to examine buffer contents by maintaining its own independent cursor position. This is particularly useful when you need to:

  • Look ahead in a buffer before deciding how to process the data
  • Parse data that might need to be rolled back
  • Implement backtracking algorithms
  • Share read access to the same buffer data from different positions

The peeker can be constrained to a specific range within the buffer, making it safe for parsing operations that should not read beyond certain boundaries.

§Examples

use bufkit::{Chunk, Peeker};

let data = b"Hello, World!";
let buf = &data[..];
let mut peeker = Peeker::new(buf);

// Read without affecting the original buffer
assert_eq!(peeker.read_u8(), b'H');
assert_eq!(peeker.read_u8(), b'e');
assert_eq!(buf.remaining(), 13); // Original buffer unchanged

// Create a constrained peeker for safe parsing
let mut word_peeker = peeker.segment(0..5); // "Hello"
assert_eq!(word_peeker.remaining(), 5);

Implementations§

Source§

impl<B> Peeker<B>

Source

pub const fn new(buf: B) -> Self

Creates a new Peeker instance with the given buffer.

The peeker starts at the beginning of the buffer’s current position and can read all remaining bytes in the buffer.

§Examples
use bufkit::{Chunk, Peeker};

let data = [1, 2, 3, 4, 5];
let buf = &data[..];
let peeker = Peeker::new(buf);
assert_eq!(peeker.remaining(), 5);
Source

pub const fn with_limit(buf: B, limit: usize) -> Self

Creates a new Peeker constrained to a specific length.

This is useful when you want to ensure the peeker cannot read beyond a certain number of bytes, providing additional safety for parsing operations.

§Examples
use bufkit::{Chunk, Peeker};

let data = b"Hello, World!";
let buf = &data[..];
let peeker = Peeker::with_limit(buf, 5); // Only peek first 5 bytes
assert_eq!(peeker.remaining(), 5);
Source

pub fn with_range(buf: B, range: impl RangeBounds<usize>) -> Self
where B: Chunk,

Creates a new Peeker with specific start and end bounds.

This provides maximum flexibility in defining the peeker’s range, allowing for more complex parsing scenarios.

§Examples
use core::ops::Bound;
use bufkit::{Chunk, Peeker};

let data = b"Hello, World!";
let buf = &data[..];

// Peek from index 2 to 7 (exclusive)
let peeker = Peeker::with_range(buf, 2..7);
assert_eq!(peeker.remaining(), 5);
Source

pub const fn position(&self) -> usize

Returns the current position of the internal cursor relative to the start of the buffer.

This represents how far the peeker’s cursor has advanced from its starting position.

§Examples
use bufkit::{Chunk, Peeker};

let data = [1, 2, 3, 4, 5];
let buf = &data[..];
let mut peeker = Peeker::new(buf);

assert_eq!(peeker.position(), 0);
peeker.read_u8();
assert_eq!(peeker.position(), 1);
peeker.advance(2);
assert_eq!(peeker.position(), 3);
Source

pub const fn absolute_position(&self) -> usize

Returns the absolute position of the peeker’s cursor in the original buffer.

This is useful for understanding where the peeker is currently reading in relation to the entire buffer, especially when the peeker has been advanced or segmented.

§Examples
use bufkit::{Chunk, Peeker};

let data = [1, 2, 3, 4, 5];
let buf = &data[..];
let mut peeker = Peeker::new(buf);

let mut seg = peeker.segment(1..4);
seg.advance(2);
assert_eq!(seg.absolute_position(), 3); // 1 (start) + 2 (advanced)

// Resetting the peeker will bring it back to the start position
seg.reset();
assert_eq!(seg.absolute_position(), 1); // Back to the start
Source

pub const fn bounds(&self) -> (Bound<usize>, Bound<usize>)

Returns the bounds of the peeker.

This is useful for understanding the range within which the peeker can read. The bounds are represented as a tuple of Bound<usize>, indicating the start and end positions.

§Examples
use core::ops::Bound;
use bufkit::{Chunk, Peeker};

let data = [1, 2, 3, 4, 5];
let buf = &data[..];
let peeker = Peeker::with_range(buf, 1..4);
assert_eq!(peeker.bounds(), (Bound::Included(1), Bound::Excluded(4)));
Source

pub const fn reset(&mut self)

Resets the peeker’s cursor to the beginning.

After calling this method, the peeker will start reading from the same position where it was initially created.

§Examples
use bufkit::{Chunk, Peeker};

let data = [1, 2, 3, 4, 5];
let buf = &data[..];
let mut peeker = Peeker::new(buf);

peeker.advance(3);
assert_eq!(peeker.position(), 3);

peeker.reset();
assert_eq!(peeker.position(), 0);
assert_eq!(peeker.remaining(), 5);
Source

pub fn into_inner(self) -> B

Consumes the peeker and returns the underlying buffer.

This is useful when you want to retrieve the original buffer after peeking operations are complete.

§Examples
use bufkit::{Chunk, Peeker};

let data = [1, 2, 3, 4, 5];
let buf = &data[..];
let peeker = Peeker::new(buf);
let original_buf = peeker.into_inner();
assert_eq!(original_buf.remaining(), 5);

Trait Implementations§

Source§

impl<B: Chunk> Chunk for Peeker<B>

Source§

fn remaining(&self) -> usize

Returns the number of bytes available for reading in the buffer. Read more
Source§

fn buffer(&self) -> &[u8]

Returns the remaining bytes of the buffer as a slice. Read more
Source§

fn advance(&mut self, cnt: usize)

Advances the internal cursor by the specified number of bytes. Read more
Source§

fn try_advance(&mut self, cnt: usize) -> Result<(), TryAdvanceError>

Attempts to advance the internal cursor by the specified number of bytes. Read more
Source§

fn segment(&self, range: impl RangeBounds<usize>) -> Self
where Self: Sized,

Creates an independent buffer containing a segment of the current buffer’s data. Read more
Source§

fn truncate(&mut self, len: usize)

Shortens the buffer to the specified length, keeping the first len bytes. Read more
Source§

fn split_off(&mut self, at: usize) -> Self
where Self: Sized,

Splits the buffer into two at the given index. Read more
Source§

fn split_to(&mut self, at: usize) -> Self
where Self: Sized,

Splits the buffer into two at the given index. Read more
Source§

fn buffer_from(&self, offset: usize) -> &[u8]

Returns a slice of the buffer starting from the specified offset. Read more
Source§

fn buffer_from_checked(&self, offset: usize) -> Option<&[u8]>

Returns a slice of the buffer starting from the specified offset. Read more
Source§

fn prefix(&self, len: usize) -> &[u8]

Returns a slice containing the first len bytes of the buffer. Read more
Source§

fn prefix_checked(&self, len: usize) -> Option<&[u8]>

Returns a slice containing the first len bytes of the buffer. Read more
Source§

fn suffix(&self, len: usize) -> &[u8]

Returns a slice containing the last len bytes of the buffer. Read more
Source§

fn suffix_checked(&self, len: usize) -> Option<&[u8]>

Returns a slice containing the last len bytes of the buffer. Read more
Source§

fn split_off_checked(&mut self, at: usize) -> Option<Self>
where Self: Sized,

Splits the buffer into two at the given index. Read more
Source§

fn try_split_off(&mut self, at: usize) -> Result<Self, OutOfBounds>
where Self: Sized,

Splits the buffer into two at the given index. Read more
Source§

fn split_to_checked(&mut self, at: usize) -> Option<Self>
where Self: Sized,

Splits the buffer into two at the given index. Read more
Source§

fn try_split_to(&mut self, at: usize) -> Result<Self, OutOfBounds>
where Self: Sized,

Splits the buffer into two at the given index. Read more
Source§

fn has_remaining(&self) -> bool

Returns true if there are bytes available for reading in the buffer. Read more
Source§

fn try_segment( &self, range: impl RangeBounds<usize>, ) -> Result<Self, TrySegmentError>
where Self: Sized,

Attempts to create a new buffer containing a segment of the current buffer’s data. Read more
Source§

fn peek_u16_le(&self) -> u16

Peeks a u16 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_u16_le_checked(&self) -> Option<u16>

Peeks a u16 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_u16_le(&self) -> Result<u16, TryPeekError>

Peeks a u16 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_u16_be(&self) -> u16

Peeks a u16 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_u16_be_checked(&self) -> Option<u16>

Peeks a u16 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_u16_be(&self) -> Result<u16, TryPeekError>

Peeks a u16 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_u16_ne(&self) -> u16

Peeks a u16 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_u16_ne_checked(&self) -> Option<u16>

Peeks a u16 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_u16_ne(&self) -> Result<u16, TryPeekError>

Peeks a u16 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_u16_le_at(&self, offset: usize) -> u16

Peeks a u16 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_u16_le_at_checked(&self, offset: usize) -> Option<u16>

Peeks a u16 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn try_peek_u16_le_at(&self, offset: usize) -> Result<u16, TryPeekAtError>

Peeks a u16 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_u16_be_at(&self, offset: usize) -> u16

Peeks a u16 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_u16_be_at_checked(&self, offset: usize) -> Option<u16>

Peeks a u16 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn try_peek_u16_be_at(&self, offset: usize) -> Result<u16, TryPeekAtError>

Peeks a u16 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_u16_ne_at(&self, offset: usize) -> u16

Peeks a u16 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_u16_ne_at_checked(&self, offset: usize) -> Option<u16>

Peeks a u16 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn try_peek_u16_ne_at(&self, offset: usize) -> Result<u16, TryPeekAtError>

Peeks a u16 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_u32_le(&self) -> u32

Peeks a u32 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_u32_le_checked(&self) -> Option<u32>

Peeks a u32 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_u32_le(&self) -> Result<u32, TryPeekError>

Peeks a u32 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_u32_be(&self) -> u32

Peeks a u32 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_u32_be_checked(&self) -> Option<u32>

Peeks a u32 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_u32_be(&self) -> Result<u32, TryPeekError>

Peeks a u32 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_u32_ne(&self) -> u32

Peeks a u32 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_u32_ne_checked(&self) -> Option<u32>

Peeks a u32 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_u32_ne(&self) -> Result<u32, TryPeekError>

Peeks a u32 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_u32_le_at(&self, offset: usize) -> u32

Peeks a u32 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_u32_le_at_checked(&self, offset: usize) -> Option<u32>

Peeks a u32 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn try_peek_u32_le_at(&self, offset: usize) -> Result<u32, TryPeekAtError>

Peeks a u32 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_u32_be_at(&self, offset: usize) -> u32

Peeks a u32 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_u32_be_at_checked(&self, offset: usize) -> Option<u32>

Peeks a u32 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn try_peek_u32_be_at(&self, offset: usize) -> Result<u32, TryPeekAtError>

Peeks a u32 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_u32_ne_at(&self, offset: usize) -> u32

Peeks a u32 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_u32_ne_at_checked(&self, offset: usize) -> Option<u32>

Peeks a u32 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn try_peek_u32_ne_at(&self, offset: usize) -> Result<u32, TryPeekAtError>

Peeks a u32 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_u64_le(&self) -> u64

Peeks a u64 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_u64_le_checked(&self) -> Option<u64>

Peeks a u64 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_u64_le(&self) -> Result<u64, TryPeekError>

Peeks a u64 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_u64_be(&self) -> u64

Peeks a u64 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_u64_be_checked(&self) -> Option<u64>

Peeks a u64 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_u64_be(&self) -> Result<u64, TryPeekError>

Peeks a u64 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_u64_ne(&self) -> u64

Peeks a u64 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_u64_ne_checked(&self) -> Option<u64>

Peeks a u64 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_u64_ne(&self) -> Result<u64, TryPeekError>

Peeks a u64 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_u64_le_at(&self, offset: usize) -> u64

Peeks a u64 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_u64_le_at_checked(&self, offset: usize) -> Option<u64>

Peeks a u64 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn try_peek_u64_le_at(&self, offset: usize) -> Result<u64, TryPeekAtError>

Peeks a u64 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_u64_be_at(&self, offset: usize) -> u64

Peeks a u64 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_u64_be_at_checked(&self, offset: usize) -> Option<u64>

Peeks a u64 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn try_peek_u64_be_at(&self, offset: usize) -> Result<u64, TryPeekAtError>

Peeks a u64 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_u64_ne_at(&self, offset: usize) -> u64

Peeks a u64 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_u64_ne_at_checked(&self, offset: usize) -> Option<u64>

Peeks a u64 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn try_peek_u64_ne_at(&self, offset: usize) -> Result<u64, TryPeekAtError>

Peeks a u64 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_u128_le(&self) -> u128

Peeks a u128 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_u128_le_checked(&self) -> Option<u128>

Peeks a u128 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_u128_le(&self) -> Result<u128, TryPeekError>

Peeks a u128 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_u128_be(&self) -> u128

Peeks a u128 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_u128_be_checked(&self) -> Option<u128>

Peeks a u128 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_u128_be(&self) -> Result<u128, TryPeekError>

Peeks a u128 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_u128_ne(&self) -> u128

Peeks a u128 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_u128_ne_checked(&self) -> Option<u128>

Peeks a u128 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_u128_ne(&self) -> Result<u128, TryPeekError>

Peeks a u128 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_u128_le_at(&self, offset: usize) -> u128

Peeks a u128 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_u128_le_at_checked(&self, offset: usize) -> Option<u128>

Peeks a u128 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn try_peek_u128_le_at(&self, offset: usize) -> Result<u128, TryPeekAtError>

Peeks a u128 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_u128_be_at(&self, offset: usize) -> u128

Peeks a u128 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_u128_be_at_checked(&self, offset: usize) -> Option<u128>

Peeks a u128 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn try_peek_u128_be_at(&self, offset: usize) -> Result<u128, TryPeekAtError>

Peeks a u128 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_u128_ne_at(&self, offset: usize) -> u128

Peeks a u128 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_u128_ne_at_checked(&self, offset: usize) -> Option<u128>

Peeks a u128 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn try_peek_u128_ne_at(&self, offset: usize) -> Result<u128, TryPeekAtError>

Peeks a u128 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_i16_le(&self) -> i16

Peeks a i16 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_i16_le_checked(&self) -> Option<i16>

Peeks a i16 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_i16_le(&self) -> Result<i16, TryPeekError>

Peeks a i16 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_i16_be(&self) -> i16

Peeks a i16 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_i16_be_checked(&self) -> Option<i16>

Peeks a i16 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_i16_be(&self) -> Result<i16, TryPeekError>

Peeks a i16 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_i16_ne(&self) -> i16

Peeks a i16 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_i16_ne_checked(&self) -> Option<i16>

Peeks a i16 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_i16_ne(&self) -> Result<i16, TryPeekError>

Peeks a i16 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_i16_le_at(&self, offset: usize) -> i16

Peeks a i16 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_i16_le_at_checked(&self, offset: usize) -> Option<i16>

Peeks a i16 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn try_peek_i16_le_at(&self, offset: usize) -> Result<i16, TryPeekAtError>

Peeks a i16 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_i16_be_at(&self, offset: usize) -> i16

Peeks a i16 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_i16_be_at_checked(&self, offset: usize) -> Option<i16>

Peeks a i16 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn try_peek_i16_be_at(&self, offset: usize) -> Result<i16, TryPeekAtError>

Peeks a i16 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_i16_ne_at(&self, offset: usize) -> i16

Peeks a i16 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_i16_ne_at_checked(&self, offset: usize) -> Option<i16>

Peeks a i16 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn try_peek_i16_ne_at(&self, offset: usize) -> Result<i16, TryPeekAtError>

Peeks a i16 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_i32_le(&self) -> i32

Peeks a i32 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_i32_le_checked(&self) -> Option<i32>

Peeks a i32 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_i32_le(&self) -> Result<i32, TryPeekError>

Peeks a i32 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_i32_be(&self) -> i32

Peeks a i32 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_i32_be_checked(&self) -> Option<i32>

Peeks a i32 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_i32_be(&self) -> Result<i32, TryPeekError>

Peeks a i32 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_i32_ne(&self) -> i32

Peeks a i32 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_i32_ne_checked(&self) -> Option<i32>

Peeks a i32 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_i32_ne(&self) -> Result<i32, TryPeekError>

Peeks a i32 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_i32_le_at(&self, offset: usize) -> i32

Peeks a i32 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_i32_le_at_checked(&self, offset: usize) -> Option<i32>

Peeks a i32 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn try_peek_i32_le_at(&self, offset: usize) -> Result<i32, TryPeekAtError>

Peeks a i32 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_i32_be_at(&self, offset: usize) -> i32

Peeks a i32 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_i32_be_at_checked(&self, offset: usize) -> Option<i32>

Peeks a i32 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn try_peek_i32_be_at(&self, offset: usize) -> Result<i32, TryPeekAtError>

Peeks a i32 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_i32_ne_at(&self, offset: usize) -> i32

Peeks a i32 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_i32_ne_at_checked(&self, offset: usize) -> Option<i32>

Peeks a i32 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn try_peek_i32_ne_at(&self, offset: usize) -> Result<i32, TryPeekAtError>

Peeks a i32 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_i64_le(&self) -> i64

Peeks a i64 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_i64_le_checked(&self) -> Option<i64>

Peeks a i64 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_i64_le(&self) -> Result<i64, TryPeekError>

Peeks a i64 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_i64_be(&self) -> i64

Peeks a i64 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_i64_be_checked(&self) -> Option<i64>

Peeks a i64 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_i64_be(&self) -> Result<i64, TryPeekError>

Peeks a i64 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_i64_ne(&self) -> i64

Peeks a i64 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_i64_ne_checked(&self) -> Option<i64>

Peeks a i64 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_i64_ne(&self) -> Result<i64, TryPeekError>

Peeks a i64 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_i64_le_at(&self, offset: usize) -> i64

Peeks a i64 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_i64_le_at_checked(&self, offset: usize) -> Option<i64>

Peeks a i64 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn try_peek_i64_le_at(&self, offset: usize) -> Result<i64, TryPeekAtError>

Peeks a i64 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_i64_be_at(&self, offset: usize) -> i64

Peeks a i64 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_i64_be_at_checked(&self, offset: usize) -> Option<i64>

Peeks a i64 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn try_peek_i64_be_at(&self, offset: usize) -> Result<i64, TryPeekAtError>

Peeks a i64 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_i64_ne_at(&self, offset: usize) -> i64

Peeks a i64 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_i64_ne_at_checked(&self, offset: usize) -> Option<i64>

Peeks a i64 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn try_peek_i64_ne_at(&self, offset: usize) -> Result<i64, TryPeekAtError>

Peeks a i64 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_i128_le(&self) -> i128

Peeks a i128 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_i128_le_checked(&self) -> Option<i128>

Peeks a i128 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_i128_le(&self) -> Result<i128, TryPeekError>

Peeks a i128 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_i128_be(&self) -> i128

Peeks a i128 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_i128_be_checked(&self) -> Option<i128>

Peeks a i128 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_i128_be(&self) -> Result<i128, TryPeekError>

Peeks a i128 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_i128_ne(&self) -> i128

Peeks a i128 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_i128_ne_checked(&self) -> Option<i128>

Peeks a i128 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_i128_ne(&self) -> Result<i128, TryPeekError>

Peeks a i128 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_i128_le_at(&self, offset: usize) -> i128

Peeks a i128 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_i128_le_at_checked(&self, offset: usize) -> Option<i128>

Peeks a i128 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn try_peek_i128_le_at(&self, offset: usize) -> Result<i128, TryPeekAtError>

Peeks a i128 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_i128_be_at(&self, offset: usize) -> i128

Peeks a i128 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_i128_be_at_checked(&self, offset: usize) -> Option<i128>

Peeks a i128 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn try_peek_i128_be_at(&self, offset: usize) -> Result<i128, TryPeekAtError>

Peeks a i128 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_i128_ne_at(&self, offset: usize) -> i128

Peeks a i128 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_i128_ne_at_checked(&self, offset: usize) -> Option<i128>

Peeks a i128 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn try_peek_i128_ne_at(&self, offset: usize) -> Result<i128, TryPeekAtError>

Peeks a i128 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_f32_le(&self) -> f32

Peeks a f32 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_f32_le_checked(&self) -> Option<f32>

Peeks a f32 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_f32_le(&self) -> Result<f32, TryPeekError>

Peeks a f32 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_f32_be(&self) -> f32

Peeks a f32 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_f32_be_checked(&self) -> Option<f32>

Peeks a f32 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_f32_be(&self) -> Result<f32, TryPeekError>

Peeks a f32 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_f32_ne(&self) -> f32

Peeks a f32 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_f32_ne_checked(&self) -> Option<f32>

Peeks a f32 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_f32_ne(&self) -> Result<f32, TryPeekError>

Peeks a f32 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_f32_le_at(&self, offset: usize) -> f32

Peeks a f32 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_f32_le_at_checked(&self, offset: usize) -> Option<f32>

Peeks a f32 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn try_peek_f32_le_at(&self, offset: usize) -> Result<f32, TryPeekAtError>

Peeks a f32 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_f32_be_at(&self, offset: usize) -> f32

Peeks a f32 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_f32_be_at_checked(&self, offset: usize) -> Option<f32>

Peeks a f32 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn try_peek_f32_be_at(&self, offset: usize) -> Result<f32, TryPeekAtError>

Peeks a f32 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_f32_ne_at(&self, offset: usize) -> f32

Peeks a f32 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_f32_ne_at_checked(&self, offset: usize) -> Option<f32>

Peeks a f32 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn try_peek_f32_ne_at(&self, offset: usize) -> Result<f32, TryPeekAtError>

Peeks a f32 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_f64_le(&self) -> f64

Peeks a f64 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_f64_le_checked(&self) -> Option<f64>

Peeks a f64 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_f64_le(&self) -> Result<f64, TryPeekError>

Peeks a f64 value from the buffer in little-endian byte order without advancing the cursor. Read more
Source§

fn peek_f64_be(&self) -> f64

Peeks a f64 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_f64_be_checked(&self) -> Option<f64>

Peeks a f64 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_f64_be(&self) -> Result<f64, TryPeekError>

Peeks a f64 value from the buffer in big-endian byte order without advancing the cursor. Read more
Source§

fn peek_f64_ne(&self) -> f64

Peeks a f64 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_f64_ne_checked(&self) -> Option<f64>

Peeks a f64 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn try_peek_f64_ne(&self) -> Result<f64, TryPeekError>

Peeks a f64 value from the buffer in native-endian byte order without advancing the cursor. Read more
Source§

fn peek_f64_le_at(&self, offset: usize) -> f64

Peeks a f64 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_f64_le_at_checked(&self, offset: usize) -> Option<f64>

Peeks a f64 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn try_peek_f64_le_at(&self, offset: usize) -> Result<f64, TryPeekAtError>

Peeks a f64 value from the buffer at the specified offset in little-endian byte order. Read more
Source§

fn peek_f64_be_at(&self, offset: usize) -> f64

Peeks a f64 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_f64_be_at_checked(&self, offset: usize) -> Option<f64>

Peeks a f64 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn try_peek_f64_be_at(&self, offset: usize) -> Result<f64, TryPeekAtError>

Peeks a f64 value from the buffer at the specified offset in big-endian byte order. Read more
Source§

fn peek_f64_ne_at(&self, offset: usize) -> f64

Peeks a f64 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn peek_f64_ne_at_checked(&self, offset: usize) -> Option<f64>

Peeks a f64 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn try_peek_f64_ne_at(&self, offset: usize) -> Result<f64, TryPeekAtError>

Peeks a f64 value from the buffer at the specified offset in native-endian byte order. Read more
Source§

fn read_u16_le(&mut self) -> u16

Reads a u16 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_u16_le_checked(&mut self) -> Option<u16>

Reads a u16 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn try_read_u16_le(&mut self) -> Result<u16, TryReadError>

Reads a u16 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_u16_be(&mut self) -> u16

Reads a u16 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_u16_be_checked(&mut self) -> Option<u16>

Reads a u16 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn try_read_u16_be(&mut self) -> Result<u16, TryReadError>

Reads a u16 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_u16_ne(&mut self) -> u16

Reads a u16 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_u16_ne_checked(&mut self) -> Option<u16>

Reads a u16 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn try_read_u16_ne(&mut self) -> Result<u16, TryReadError>

Reads a u16 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_u32_le(&mut self) -> u32

Reads a u32 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_u32_le_checked(&mut self) -> Option<u32>

Reads a u32 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn try_read_u32_le(&mut self) -> Result<u32, TryReadError>

Reads a u32 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_u32_be(&mut self) -> u32

Reads a u32 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_u32_be_checked(&mut self) -> Option<u32>

Reads a u32 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn try_read_u32_be(&mut self) -> Result<u32, TryReadError>

Reads a u32 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_u32_ne(&mut self) -> u32

Reads a u32 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_u32_ne_checked(&mut self) -> Option<u32>

Reads a u32 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn try_read_u32_ne(&mut self) -> Result<u32, TryReadError>

Reads a u32 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_u64_le(&mut self) -> u64

Reads a u64 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_u64_le_checked(&mut self) -> Option<u64>

Reads a u64 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn try_read_u64_le(&mut self) -> Result<u64, TryReadError>

Reads a u64 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_u64_be(&mut self) -> u64

Reads a u64 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_u64_be_checked(&mut self) -> Option<u64>

Reads a u64 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn try_read_u64_be(&mut self) -> Result<u64, TryReadError>

Reads a u64 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_u64_ne(&mut self) -> u64

Reads a u64 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_u64_ne_checked(&mut self) -> Option<u64>

Reads a u64 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn try_read_u64_ne(&mut self) -> Result<u64, TryReadError>

Reads a u64 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_u128_le(&mut self) -> u128

Reads a u128 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_u128_le_checked(&mut self) -> Option<u128>

Reads a u128 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn try_read_u128_le(&mut self) -> Result<u128, TryReadError>

Reads a u128 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_u128_be(&mut self) -> u128

Reads a u128 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_u128_be_checked(&mut self) -> Option<u128>

Reads a u128 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn try_read_u128_be(&mut self) -> Result<u128, TryReadError>

Reads a u128 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_u128_ne(&mut self) -> u128

Reads a u128 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_u128_ne_checked(&mut self) -> Option<u128>

Reads a u128 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn try_read_u128_ne(&mut self) -> Result<u128, TryReadError>

Reads a u128 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_i16_le(&mut self) -> i16

Reads a i16 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_i16_le_checked(&mut self) -> Option<i16>

Reads a i16 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn try_read_i16_le(&mut self) -> Result<i16, TryReadError>

Reads a i16 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_i16_be(&mut self) -> i16

Reads a i16 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_i16_be_checked(&mut self) -> Option<i16>

Reads a i16 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn try_read_i16_be(&mut self) -> Result<i16, TryReadError>

Reads a i16 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_i16_ne(&mut self) -> i16

Reads a i16 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_i16_ne_checked(&mut self) -> Option<i16>

Reads a i16 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn try_read_i16_ne(&mut self) -> Result<i16, TryReadError>

Reads a i16 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_i32_le(&mut self) -> i32

Reads a i32 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_i32_le_checked(&mut self) -> Option<i32>

Reads a i32 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn try_read_i32_le(&mut self) -> Result<i32, TryReadError>

Reads a i32 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_i32_be(&mut self) -> i32

Reads a i32 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_i32_be_checked(&mut self) -> Option<i32>

Reads a i32 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn try_read_i32_be(&mut self) -> Result<i32, TryReadError>

Reads a i32 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_i32_ne(&mut self) -> i32

Reads a i32 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_i32_ne_checked(&mut self) -> Option<i32>

Reads a i32 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn try_read_i32_ne(&mut self) -> Result<i32, TryReadError>

Reads a i32 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_i64_le(&mut self) -> i64

Reads a i64 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_i64_le_checked(&mut self) -> Option<i64>

Reads a i64 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn try_read_i64_le(&mut self) -> Result<i64, TryReadError>

Reads a i64 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_i64_be(&mut self) -> i64

Reads a i64 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_i64_be_checked(&mut self) -> Option<i64>

Reads a i64 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn try_read_i64_be(&mut self) -> Result<i64, TryReadError>

Reads a i64 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_i64_ne(&mut self) -> i64

Reads a i64 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_i64_ne_checked(&mut self) -> Option<i64>

Reads a i64 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn try_read_i64_ne(&mut self) -> Result<i64, TryReadError>

Reads a i64 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_i128_le(&mut self) -> i128

Reads a i128 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_i128_le_checked(&mut self) -> Option<i128>

Reads a i128 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn try_read_i128_le(&mut self) -> Result<i128, TryReadError>

Reads a i128 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_i128_be(&mut self) -> i128

Reads a i128 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_i128_be_checked(&mut self) -> Option<i128>

Reads a i128 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn try_read_i128_be(&mut self) -> Result<i128, TryReadError>

Reads a i128 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_i128_ne(&mut self) -> i128

Reads a i128 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_i128_ne_checked(&mut self) -> Option<i128>

Reads a i128 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn try_read_i128_ne(&mut self) -> Result<i128, TryReadError>

Reads a i128 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_f32_le(&mut self) -> f32

Reads a f32 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_f32_le_checked(&mut self) -> Option<f32>

Reads a f32 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn try_read_f32_le(&mut self) -> Result<f32, TryReadError>

Reads a f32 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_f32_be(&mut self) -> f32

Reads a f32 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_f32_be_checked(&mut self) -> Option<f32>

Reads a f32 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn try_read_f32_be(&mut self) -> Result<f32, TryReadError>

Reads a f32 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_f32_ne(&mut self) -> f32

Reads a f32 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_f32_ne_checked(&mut self) -> Option<f32>

Reads a f32 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn try_read_f32_ne(&mut self) -> Result<f32, TryReadError>

Reads a f32 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_f64_le(&mut self) -> f64

Reads a f64 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_f64_le_checked(&mut self) -> Option<f64>

Reads a f64 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn try_read_f64_le(&mut self) -> Result<f64, TryReadError>

Reads a f64 value from the buffer in little-endian byte order and advances the cursor. Read more
Source§

fn read_f64_be(&mut self) -> f64

Reads a f64 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_f64_be_checked(&mut self) -> Option<f64>

Reads a f64 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn try_read_f64_be(&mut self) -> Result<f64, TryReadError>

Reads a f64 value from the buffer in big-endian byte order and advances the cursor. Read more
Source§

fn read_f64_ne(&mut self) -> f64

Reads a f64 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn read_f64_ne_checked(&mut self) -> Option<f64>

Reads a f64 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn try_read_f64_ne(&mut self) -> Result<f64, TryReadError>

Reads a f64 value from the buffer in native-endian byte order and advances the cursor. Read more
Source§

fn peek_u8(&self) -> u8

Peeks a u8 value from the buffer without advancing the internal cursor. Read more
Source§

fn peek_u8_checked(&self) -> Option<u8>

Peeks a u8 value from the buffer without advancing the internal cursor. Read more
Source§

fn try_peek_u8(&self) -> Result<u8, TryPeekError>

Peeks a u8 value from the buffer without advancing the internal cursor. Read more
Source§

fn peek_u8_at(&self, offset: usize) -> u8

Peeks a u8 value from the buffer at the specified offset without advancing the cursor. Read more
Source§

fn peek_u8_at_checked(&self, offset: usize) -> Option<u8>

Peeks a u8 value from the buffer at the specified offset without advancing the cursor. Read more
Source§

fn try_peek_u8_at(&self, offset: usize) -> Result<u8, TryPeekAtError>

Peeks a u8 value from the buffer at the specified offset without advancing the cursor. Read more
Source§

fn peek_i8_at(&self, offset: usize) -> i8

Peeks an i8 value from the buffer at the specified offset without advancing the cursor. Read more
Source§

fn peek_i8_at_checked(&self, offset: usize) -> Option<i8>

Peeks an i8 value from the buffer at the specified offset without advancing the cursor. Read more
Source§

fn try_peek_i8_at(&self, offset: usize) -> Result<i8, TryPeekAtError>

Peeks an i8 value from the buffer at the specified offset without advancing the cursor. Read more
Source§

fn read_u8(&mut self) -> u8

Reads a u8 value from the buffer and advances the internal cursor. Read more
Source§

fn read_u8_checked(&mut self) -> Option<u8>

Reads a u8 value from the buffer and advances the internal cursor. Read more
Source§

fn try_read_u8(&mut self) -> Result<u8, TryReadError>

Reads a u8 value from the buffer and advances the internal cursor. Read more
Source§

fn peek_i8(&self) -> i8

Peeks an i8 value from the buffer without advancing the internal cursor. Read more
Source§

fn peek_i8_checked(&self) -> Option<i8>

Peeks an i8 value from the buffer without advancing the internal cursor. Read more
Source§

fn try_peek_i8(&self) -> Result<i8, TryPeekError>

Peeks an i8 value from the buffer without advancing the internal cursor. Read more
Source§

fn read_i8(&mut self) -> i8

Reads an i8 value from the buffer and advances the internal cursor. Read more
Source§

fn read_i8_checked(&mut self) -> Option<i8>

Reads an i8 value from the buffer and advances the internal cursor. Read more
Source§

fn try_read_i8(&mut self) -> Result<i8, TryReadError>

Reads an i8 value from the buffer and advances the internal cursor. Read more
Source§

fn to_vec(&self) -> Vec<u8>

Available on crate features std or alloc only.
Converts the read buffer to a Vec<u8> instance. Read more
Source§

fn to_bytes(&self) -> Bytes

Available on crate feature bytes_1 and (crate features std or alloc) only.
Converts the read buffer to a Bytes instance. Read more
Source§

fn to_bytes_mut(&self) -> BytesMut

Available on crate feature bytes_1 and (crate features std or alloc) only.
Converts the read buffer to a BytesMut instance. Read more
Source§

impl<B: Clone> Clone for Peeker<B>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<B: Debug + ?Sized> Debug for Peeker<B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<B> From<B> for Peeker<B>

Source§

fn from(buf: B) -> Self

Converts to this type from the input type.
Source§

impl<B: PartialEq + ?Sized> PartialEq for Peeker<B>

Source§

fn eq(&self, other: &Peeker<B>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<B: Copy> Copy for Peeker<B>

Source§

impl<B: Eq + ?Sized> Eq for Peeker<B>

Source§

impl<B: ?Sized> StructuralPartialEq for Peeker<B>

Auto Trait Implementations§

§

impl<B> Freeze for Peeker<B>
where B: Freeze + ?Sized,

§

impl<B> RefUnwindSafe for Peeker<B>
where B: RefUnwindSafe + ?Sized,

§

impl<B> Send for Peeker<B>
where B: Send + ?Sized,

§

impl<B> Sync for Peeker<B>
where B: Sync + ?Sized,

§

impl<B> Unpin for Peeker<B>
where B: Unpin + ?Sized,

§

impl<B> UnwindSafe for Peeker<B>
where B: UnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ChunkExt for T
where T: Chunk,

Source§

fn peek_array<const N: usize>(&self) -> [u8; N]

Peeks a fixed-size array from the beginning of the buffer without advancing the cursor. Read more
Source§

fn peek_array_checked<const N: usize>(&self) -> Option<[u8; N]>

Peeks a fixed-size array from the beginning of the buffer without advancing the cursor. Read more
Source§

fn try_peek_array<const N: usize>(&self) -> Result<[u8; N], TryPeekError>

Peeks a fixed-size array from the beginning of the buffer without advancing the cursor. Read more
Source§

fn peek_array_at<const N: usize>(&self, offset: usize) -> [u8; N]

Peeks a fixed-size array from the buffer at the specified offset without advancing the cursor. Read more
Source§

fn peek_array_at_checked<const N: usize>( &self, offset: usize, ) -> Option<[u8; N]>

Peeks a fixed-size array from the buffer at the specified offset without advancing the cursor. Read more
Source§

fn try_peek_array_at<const N: usize>( &self, offset: usize, ) -> Result<[u8; N], TryPeekAtError>

Peeks a fixed-size array from the buffer at the specified offset without advancing the cursor. Read more
Source§

fn read_array<const N: usize>(&mut self) -> [u8; N]

Reads a fixed-size array from the buffer and advances the internal cursor. Read more
Source§

fn read_array_checked<const N: usize>(&mut self) -> Option<[u8; N]>

Reads a fixed-size array from the buffer and advances the internal cursor. Read more
Source§

fn try_read_array<const N: usize>(&mut self) -> Result<[u8; N], TryReadError>

Reads a fixed-size array from the buffer and advances the internal cursor. Read more
Source§

fn peek_varint<V: Varint>(&self) -> Result<(NonZeroUsize, V), DecodeVarintError>

Available on crate feature varint only.
Peeks a variable-length encoded type from the buffer without advancing the internal cursor. Read more
Source§

fn read_varint<V: Varint>( &mut self, ) -> Result<(NonZeroUsize, V), DecodeVarintError>

Available on crate feature varint only.
Reads a variable-length encoded type from the buffer and advances the internal cursor. Read more
Source§

fn try_scan_varint(&mut self) -> Result<NonZeroUsize, DecodeVarintError>

Available on crate feature varint only.
Skips a variable-length encoded type in the buffer without advancing the internal cursor. Read more
Source§

fn try_scan_varint_at( &mut self, offset: usize, ) -> Result<NonZeroUsize, DecodeVarintAtError>

Available on crate feature varint only.
Skips a variable-length encoded type in the buffer at the specified offset without advancing the cursor. Read more
Source§

fn try_consume_varint(&mut self) -> Result<NonZeroUsize, DecodeVarintError>

Available on crate feature varint only.
Skips a variable-length encoded type in the buffer and advances the internal cursor. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.