Skip to main content

BufferedLeb128Reader

Struct BufferedLeb128Reader 

Source
pub struct BufferedLeb128Reader<R, P>
where R: Input<Item = u8>,
{ /* private fields */ }
Expand description

Buffered reader for LEB128 integers.

Values are decoded directly from the internal input buffer while the codec scans for the LEB128 terminating byte.

§Buffered state

This reader may prefetch bytes from the wrapped reader. As a result, Self::inner can observe an underlying stream position ahead of the logical position exposed by this wrapper.

§Target-width integers

usize and isize methods use the current Rust target’s pointer width. Prefer fixed-width integer methods such as read_u64 or read_i64 for persistent files and cross-platform protocols.

§Type Parameters

  • R: Underlying byte input.
  • P: LEB128 canonicality policy.

Implementations§

Source§

impl<R, P> BufferedLeb128Reader<R, P>
where R: Input<Item = u8>, P: Leb128DecodePolicy,

Source

pub fn new(inner: R) -> Self

Creates a buffered LEB128 reader with the default buffer capacity.

§Parameters
  • inner: Underlying byte input.
§Returns

Returns a buffered reader using policy P.

Source

pub fn with_capacity(inner: R, capacity: usize) -> Self

Creates a buffered LEB128 reader with at least capacity bytes.

§Parameters
  • inner: Underlying byte input.
  • capacity: Requested internal buffer capacity in bytes.
§Returns

Returns a buffered reader whose capacity also satisfies the largest supported codec payload.

Source

pub fn try_with_capacity( inner: R, capacity: usize, ) -> Result<Self, TryReserveError>

Tries to create a buffered LEB128 reader with at least capacity bytes.

§Errors

Returns an allocation error when the requested buffer cannot be allocated.

Source

pub const fn is_strict(&self) -> bool

Returns whether this reader rejects non-canonical encodings.

§Returns

Returns true when policy P requires canonical encodings.

Source

pub const fn inner(&self) -> &R

Returns a shared reference to the underlying reader.

The underlying reader may already be positioned past unread bytes held in this wrapper’s internal buffer.

§Returns

Returns the wrapped reader.

Source

pub fn into_parts(self) -> (R, Buffer<u8>)

Consumes this wrapper and preserves its unread buffered bytes.

§Returns

Returns the wrapped reader and the buffer whose Buffer::readable slice contains every prefetched byte not yet consumed logically. To continue the same logical stream, consume that slice before reading from the returned reader.

Source§

impl<R> BufferedLeb128Reader<R, NonStrict>
where R: Input<Item = u8>,

Source

pub fn read_u8_non_strict(&mut self) -> Result<u8>

Reads an unsigned LEB128 u8.

§Returns

Returns the decoded u8.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_u16_non_strict(&mut self) -> Result<u16>

Reads an unsigned LEB128 u16.

§Returns

Returns the decoded u16.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_u32_non_strict(&mut self) -> Result<u32>

Reads an unsigned LEB128 u32.

§Returns

Returns the decoded u32.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_u64_non_strict(&mut self) -> Result<u64>

Reads an unsigned LEB128 u64.

§Returns

Returns the decoded u64.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_u128_non_strict(&mut self) -> Result<u128>

Reads an unsigned LEB128 u128.

§Returns

Returns the decoded u128.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_usize_non_strict(&mut self) -> Result<usize>

Reads an unsigned LEB128 usize.

§Returns

Returns the decoded usize.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_i8_non_strict(&mut self) -> Result<i8>

Reads a signed LEB128 i8.

§Returns

Returns the decoded i8.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_i16_non_strict(&mut self) -> Result<i16>

Reads a signed LEB128 i16.

§Returns

Returns the decoded i16.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_i32_non_strict(&mut self) -> Result<i32>

Reads a signed LEB128 i32.

§Returns

Returns the decoded i32.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_i64_non_strict(&mut self) -> Result<i64>

Reads a signed LEB128 i64.

§Returns

Returns the decoded i64.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_i128_non_strict(&mut self) -> Result<i128>

Reads a signed LEB128 i128.

§Returns

Returns the decoded i128.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_isize_non_strict(&mut self) -> Result<isize>

Reads a signed LEB128 isize.

§Returns

Returns the decoded isize.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_utf8_string_usize_non_strict( &mut self, max_len: usize, ) -> Result<String>

Reads a UTF-8 string prefixed by an unsigned LEB128 byte length.

The length prefix is decoded as usize, so this format is target-width dependent. Prefer a fixed-width length prefix for persistent files and cross-platform protocols.

§Parameters
  • max_len: Maximum accepted UTF-8 payload length in bytes.
§Returns

Returns the decoded UTF-8 string.

§Errors

Returns an input or allocation error, or an invalid-data error for a malformed or excessive length or invalid UTF-8.

Source

pub fn read_utf8_string_u64_non_strict( &mut self, max_len: usize, ) -> Result<String>

Reads a UTF-8 string prefixed by an unsigned LEB128 u64 byte length.

Prefer this method over the usize variant for persistent files and cross-platform protocols because the length field is independent of the current Rust target’s pointer width.

§Parameters
  • max_len: Maximum accepted UTF-8 payload length in bytes.
§Returns

Returns the decoded UTF-8 string.

§Errors

Returns an input, conversion, or allocation error, or an invalid-data error for a malformed or excessive length or invalid UTF-8.

Source§

impl<R> BufferedLeb128Reader<R, Strict>
where R: Input<Item = u8>,

Source

pub fn read_u8(&mut self) -> Result<u8>

Reads an unsigned LEB128 u8.

§Returns

Returns the decoded u8.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_u16(&mut self) -> Result<u16>

Reads an unsigned LEB128 u16.

§Returns

Returns the decoded u16.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_u32(&mut self) -> Result<u32>

Reads an unsigned LEB128 u32.

§Returns

Returns the decoded u32.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_u64(&mut self) -> Result<u64>

Reads an unsigned LEB128 u64.

§Returns

Returns the decoded u64.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_u128(&mut self) -> Result<u128>

Reads an unsigned LEB128 u128.

§Returns

Returns the decoded u128.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_usize(&mut self) -> Result<usize>

Reads an unsigned LEB128 usize.

§Returns

Returns the decoded usize.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_i8(&mut self) -> Result<i8>

Reads a signed LEB128 i8.

§Returns

Returns the decoded i8.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_i16(&mut self) -> Result<i16>

Reads a signed LEB128 i16.

§Returns

Returns the decoded i16.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_i32(&mut self) -> Result<i32>

Reads a signed LEB128 i32.

§Returns

Returns the decoded i32.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_i64(&mut self) -> Result<i64>

Reads a signed LEB128 i64.

§Returns

Returns the decoded i64.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_i128(&mut self) -> Result<i128>

Reads a signed LEB128 i128.

§Returns

Returns the decoded i128.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_isize(&mut self) -> Result<isize>

Reads a signed LEB128 isize.

§Returns

Returns the decoded isize.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

Source

pub fn read_utf8_string_usize(&mut self, max_len: usize) -> Result<String>

Reads a UTF-8 string prefixed by an unsigned LEB128 byte length.

The length prefix is decoded as usize, so this format is target-width dependent. Prefer a fixed-width length prefix for persistent files and cross-platform protocols.

§Parameters
  • max_len: Maximum accepted UTF-8 payload length in bytes.
§Returns

Returns the decoded UTF-8 string.

§Errors

Returns an input or allocation error, or an invalid-data error for a malformed or excessive length or invalid UTF-8.

Source

pub fn read_utf8_string_u64(&mut self, max_len: usize) -> Result<String>

Reads a UTF-8 string prefixed by an unsigned LEB128 u64 byte length.

Prefer this method over the usize variant for persistent files and cross-platform protocols because the length field is independent of the current Rust target’s pointer width.

§Parameters
  • max_len: Maximum accepted UTF-8 payload length in bytes.
§Returns

Returns the decoded UTF-8 string.

§Errors

Returns an input, conversion, or allocation error, or an invalid-data error for a malformed or excessive length or invalid UTF-8.

Source§

impl<R, P> BufferedLeb128Reader<R, P>
where R: Input<Item = u8>,

Source

pub fn is_buffered(&self) -> bool

Returns whether this reader buffers input.

Source

pub unsafe fn read_unchecked( &mut self, output: &mut [u8], index: usize, count: usize, ) -> Result<usize>

Reads up to count bytes into an indexed output range.

§Safety

index..index + count must be a valid range within output.

Source

pub fn read(&mut self, output: &mut [u8]) -> Result<usize>

Reads bytes into the full output slice.

Source

pub unsafe fn read_fully_unchecked( &mut self, output: &mut [u8], index: usize, count: usize, ) -> Result<usize>

Reads bytes into an indexed range until it is full or EOF.

§Safety

index..index + count must be a valid range within output.

Source

pub fn read_fully(&mut self, output: &mut [u8]) -> Result<usize>

Reads bytes into the full output slice until it is full or EOF.

Source

pub fn read_exactly(&mut self, output: &mut [u8]) -> Result<()>

Reads bytes until the full output slice is filled.

Source§

impl<R, P> BufferedLeb128Reader<R, P>
where R: Input<Item = u8> + Seekable<Unit = u8>,

Source

pub fn seek_to(&mut self, position: SeekFrom) -> Result<u64>

Seeks the wrapped byte stream.

Trait Implementations§

Source§

impl<R, P> Input for BufferedLeb128Reader<R, P>
where R: Input<Item = u8>,

Source§

fn is_buffered(&self) -> bool

Reports that this adapter buffers input.

§Returns

Always returns true.

Source§

unsafe fn read_unchecked( &mut self, output: &mut [u8], index: usize, count: usize, ) -> Result<usize>

Reads up to count bytes into an indexed output range.

§Parameters
  • output: Destination slice.
  • index: First destination index.
  • count: Maximum number of bytes to read.
§Returns

Returns the number of bytes read.

§Errors

Returns an error reported while reading the buffered input.

§Safety

index..index + count must be a valid range within output.

Source§

type Item = u8

The item type read from this input.
Source§

fn read(&mut self, output: &mut [Self::Item]) -> Result<usize, Error>

Reads items into the full output slice. Read more
Source§

unsafe fn read_fully_unchecked( &mut self, output: &mut [Self::Item], index: usize, count: usize, ) -> Result<usize, Error>

Reads items into an indexed output range until it is full or EOF is reached. Read more
Source§

fn read_fully(&mut self, output: &mut [Self::Item]) -> Result<usize, Error>

Reads items into the full output slice until it is full or EOF is reached. Read more
Source§

fn read_exactly(&mut self, output: &mut [Self::Item]) -> Result<(), Error>

Reads items until the full output slice is filled. Read more
Source§

impl<R, P> Seekable for BufferedLeb128Reader<R, P>
where R: Input<Item = u8> + Seekable<Unit = u8>,

Source§

fn seek_to(&mut self, position: SeekFrom) -> Result<u64>

Seeks the wrapped reader and discards buffered bytes after success.

§Parameters
  • position: Target seek position.
§Returns

Returns the new physical stream position.

§Errors

Returns the seek error reported by the wrapped reader and preserves buffered bytes when seeking fails.

Source§

type Unit = u8

The unit type used to measure seek positions and offsets.

Auto Trait Implementations§

§

impl<R, P> Freeze for BufferedLeb128Reader<R, P>
where R: Freeze,

§

impl<R, P> RefUnwindSafe for BufferedLeb128Reader<R, P>
where R: RefUnwindSafe,

§

impl<R, P> Send for BufferedLeb128Reader<R, P>
where R: Send,

§

impl<R, P> Sync for BufferedLeb128Reader<R, P>
where R: Sync,

§

impl<R, P> Unpin for BufferedLeb128Reader<R, P>
where R: Unpin,

§

impl<R, P> UnsafeUnpin for BufferedLeb128Reader<R, P>
where R: UnsafeUnpin,

§

impl<R, P> UnwindSafe for BufferedLeb128Reader<R, P>
where R: UnwindSafe,

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<R> BinaryReadExt for R
where R: Input<Item = u8> + ?Sized,

Source§

fn read_u8(&mut self) -> Result<u8>

Reads an unsigned 8-bit integer. Read more
Source§

fn read_i8(&mut self) -> Result<i8>

Reads a signed 8-bit integer. Read more
Source§

fn read_u16(&mut self, byte_order: ByteOrder) -> Result<u16>

Reads an unsigned 16-bit integer using a runtime byte order. Read more
Source§

fn read_u16_be(&mut self) -> Result<u16>

Reads a big-endian unsigned 16-bit integer. Read more
Source§

fn read_u16_le(&mut self) -> Result<u16>

Reads a little-endian unsigned 16-bit integer. Read more
Source§

fn read_u32(&mut self, byte_order: ByteOrder) -> Result<u32>

Reads an unsigned 32-bit integer using a runtime byte order. Read more
Source§

fn read_u32_be(&mut self) -> Result<u32>

Reads a big-endian unsigned 32-bit integer. Read more
Source§

fn read_u32_le(&mut self) -> Result<u32>

Reads a little-endian unsigned 32-bit integer. Read more
Source§

fn read_u64(&mut self, byte_order: ByteOrder) -> Result<u64>

Reads an unsigned 64-bit integer using a runtime byte order. Read more
Source§

fn read_u64_be(&mut self) -> Result<u64>

Reads a big-endian unsigned 64-bit integer. Read more
Source§

fn read_u64_le(&mut self) -> Result<u64>

Reads a little-endian unsigned 64-bit integer. Read more
Source§

fn read_u128(&mut self, byte_order: ByteOrder) -> Result<u128>

Reads an unsigned 128-bit integer using a runtime byte order. Read more
Source§

fn read_u128_be(&mut self) -> Result<u128>

Reads a big-endian unsigned 128-bit integer. Read more
Source§

fn read_u128_le(&mut self) -> Result<u128>

Reads a little-endian unsigned 128-bit integer. Read more
Source§

fn read_i16(&mut self, byte_order: ByteOrder) -> Result<i16>

Reads a signed 16-bit integer using a runtime byte order. Read more
Source§

fn read_i16_be(&mut self) -> Result<i16>

Reads a big-endian signed 16-bit integer. Read more
Source§

fn read_i16_le(&mut self) -> Result<i16>

Reads a little-endian signed 16-bit integer. Read more
Source§

fn read_i32(&mut self, byte_order: ByteOrder) -> Result<i32>

Reads a signed 32-bit integer using a runtime byte order. Read more
Source§

fn read_i32_be(&mut self) -> Result<i32>

Reads a big-endian signed 32-bit integer. Read more
Source§

fn read_i32_le(&mut self) -> Result<i32>

Reads a little-endian signed 32-bit integer. Read more
Source§

fn read_i64(&mut self, byte_order: ByteOrder) -> Result<i64>

Reads a signed 64-bit integer using a runtime byte order. Read more
Source§

fn read_i64_be(&mut self) -> Result<i64>

Reads a big-endian signed 64-bit integer. Read more
Source§

fn read_i64_le(&mut self) -> Result<i64>

Reads a little-endian signed 64-bit integer. Read more
Source§

fn read_i128(&mut self, byte_order: ByteOrder) -> Result<i128>

Reads a signed 128-bit integer using a runtime byte order. Read more
Source§

fn read_i128_be(&mut self) -> Result<i128>

Reads a big-endian signed 128-bit integer. Read more
Source§

fn read_i128_le(&mut self) -> Result<i128>

Reads a little-endian signed 128-bit integer. Read more
Source§

fn read_f32(&mut self, byte_order: ByteOrder) -> Result<f32>

Reads a 32-bit float using a runtime byte order. Read more
Source§

fn read_f32_be(&mut self) -> Result<f32>

Reads a big-endian 32-bit float. Read more
Source§

fn read_f32_le(&mut self) -> Result<f32>

Reads a little-endian 32-bit float. Read more
Source§

fn read_f64(&mut self, byte_order: ByteOrder) -> Result<f64>

Reads a 64-bit float using a runtime byte order. Read more
Source§

fn read_f64_be(&mut self) -> Result<f64>

Reads a big-endian 64-bit float. Read more
Source§

fn read_f64_le(&mut self) -> Result<f64>

Reads a little-endian 64-bit float. 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> 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<R> Leb128ReadExt for R
where R: Input<Item = u8> + ?Sized,

Source§

fn read_uleb_u8_non_strict(&mut self) -> Result<u8>

Reads a non-strict unsigned LEB128 u8. Read more
Source§

fn read_uleb_u8_strict(&mut self) -> Result<u8>

Reads a strict unsigned LEB128 u8. Read more
Source§

fn read_uleb_u16_non_strict(&mut self) -> Result<u16>

Reads a non-strict unsigned LEB128 u16. Read more
Source§

fn read_uleb_u16_strict(&mut self) -> Result<u16>

Reads a strict unsigned LEB128 u16. Read more
Source§

fn read_uleb_u32_non_strict(&mut self) -> Result<u32>

Reads a non-strict unsigned LEB128 u32. Read more
Source§

fn read_uleb_u32_strict(&mut self) -> Result<u32>

Reads a strict unsigned LEB128 u32. Read more
Source§

fn read_uleb_u64_non_strict(&mut self) -> Result<u64>

Reads a non-strict unsigned LEB128 u64. Read more
Source§

fn read_uleb_u64_strict(&mut self) -> Result<u64>

Reads a strict unsigned LEB128 u64. Read more
Source§

fn read_uleb_u128_non_strict(&mut self) -> Result<u128>

Reads a non-strict unsigned LEB128 u128. Read more
Source§

fn read_uleb_u128_strict(&mut self) -> Result<u128>

Reads a strict unsigned LEB128 u128. Read more
Source§

fn read_uleb_usize_non_strict(&mut self) -> Result<usize>

Reads a non-strict unsigned LEB128 usize. Read more
Source§

fn read_uleb_usize_strict(&mut self) -> Result<usize>

Reads a strict unsigned LEB128 usize. Read more
Source§

fn read_sleb_i8_non_strict(&mut self) -> Result<i8>

Reads a non-strict signed LEB128 i8. Read more
Source§

fn read_sleb_i8_strict(&mut self) -> Result<i8>

Reads a strict signed LEB128 i8. Read more
Source§

fn read_sleb_i16_non_strict(&mut self) -> Result<i16>

Reads a non-strict signed LEB128 i16. Read more
Source§

fn read_sleb_i16_strict(&mut self) -> Result<i16>

Reads a strict signed LEB128 i16. Read more
Source§

fn read_sleb_i32_non_strict(&mut self) -> Result<i32>

Reads a non-strict signed LEB128 i32. Read more
Source§

fn read_sleb_i32_strict(&mut self) -> Result<i32>

Reads a strict signed LEB128 i32. Read more
Source§

fn read_sleb_i64_non_strict(&mut self) -> Result<i64>

Reads a non-strict signed LEB128 i64. Read more
Source§

fn read_sleb_i64_strict(&mut self) -> Result<i64>

Reads a strict signed LEB128 i64. Read more
Source§

fn read_sleb_i128_non_strict(&mut self) -> Result<i128>

Reads a non-strict signed LEB128 i128. Read more
Source§

fn read_sleb_i128_strict(&mut self) -> Result<i128>

Reads a strict signed LEB128 i128. Read more
Source§

fn read_sleb_isize_non_strict(&mut self) -> Result<isize>

Reads a non-strict signed LEB128 isize. Read more
Source§

fn read_sleb_isize_strict(&mut self) -> Result<isize>

Reads a strict signed LEB128 isize. Read more
Source§

impl<T> StringReadExt for T
where T: Input<Item = u8> + ?Sized,

Source§

fn read_utf8_payload_into( &mut self, bytes: &mut Vec<u8>, len: usize, max_len: usize, ) -> Result<(), Error>

Reads and validates a UTF-8 payload into reusable byte storage. Read more
Source§

fn read_utf8_payload( &mut self, len: usize, max_len: usize, ) -> Result<String, Error>

Reads a UTF-8 payload with an already decoded byte length. Read more
Source§

fn read_utf8_string_uleb_usize( &mut self, max_len: usize, ) -> Result<String, Error>

Reads a UTF-8 string with an unsigned LEB128 byte-length prefix. Read more
Source§

fn read_utf8_string_uleb_usize_strict( &mut self, max_len: usize, ) -> Result<String, Error>

Reads a UTF-8 string with a canonical unsigned LEB128 byte-length prefix. Read more
Source§

fn read_utf8_string_uleb_u64(&mut self, max_len: usize) -> Result<String, Error>

Reads a UTF-8 string with an unsigned LEB128 u64 byte-length prefix. Read more
Source§

fn read_utf8_string_uleb_u64_strict( &mut self, max_len: usize, ) -> Result<String, Error>

Reads a UTF-8 string with a canonical unsigned LEB128 u64 byte-length prefix. Read more
Source§

fn read_string_with_u16_len( &mut self, byte_order: ByteOrder, max_len: usize, ) -> Result<String, Error>

Reads a UTF-8 string with a runtime-order u16 byte-length prefix. Read more
Source§

fn read_string_with_u16_len_be( &mut self, max_len: usize, ) -> Result<String, Error>

Reads a UTF-8 string with a big-endian u16 byte-length prefix. Read more
Source§

fn read_string_with_u16_len_le( &mut self, max_len: usize, ) -> Result<String, Error>

Reads a UTF-8 string with a little-endian u16 byte-length prefix. Read more
Source§

fn read_string_with_u32_len( &mut self, byte_order: ByteOrder, max_len: usize, ) -> Result<String, Error>

Reads a UTF-8 string with a runtime-order u32 byte-length prefix. Read more
Source§

fn read_string_with_u32_len_be( &mut self, max_len: usize, ) -> Result<String, Error>

Reads a UTF-8 string with a big-endian u32 byte-length prefix. Read more
Source§

fn read_string_with_u32_len_le( &mut self, max_len: usize, ) -> Result<String, Error>

Reads a UTF-8 string with a little-endian u32 byte-length prefix. 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.
Source§

impl<R> ZigZagReadExt for R
where R: Input<Item = u8> + ?Sized,

Source§

fn read_zig_zag_i8_non_strict(&mut self) -> Result<i8>

Reads a non-strict ZigZag i8. Read more
Source§

fn read_zig_zag_i8_strict(&mut self) -> Result<i8>

Reads a strict ZigZag i8. Read more
Source§

fn read_zig_zag_i16_non_strict(&mut self) -> Result<i16>

Reads a non-strict ZigZag i16. Read more
Source§

fn read_zig_zag_i16_strict(&mut self) -> Result<i16>

Reads a strict ZigZag i16. Read more
Source§

fn read_zig_zag_i32_non_strict(&mut self) -> Result<i32>

Reads a non-strict ZigZag i32. Read more
Source§

fn read_zig_zag_i32_strict(&mut self) -> Result<i32>

Reads a strict ZigZag i32. Read more
Source§

fn read_zig_zag_i64_non_strict(&mut self) -> Result<i64>

Reads a non-strict ZigZag i64. Read more
Source§

fn read_zig_zag_i64_strict(&mut self) -> Result<i64>

Reads a strict ZigZag i64. Read more
Source§

fn read_zig_zag_i128_non_strict(&mut self) -> Result<i128>

Reads a non-strict ZigZag i128. Read more
Source§

fn read_zig_zag_i128_strict(&mut self) -> Result<i128>

Reads a strict ZigZag i128. Read more
Source§

fn read_zig_zag_isize_non_strict(&mut self) -> Result<isize>

Reads a non-strict ZigZag isize. Read more
Source§

fn read_zig_zag_isize_strict(&mut self) -> Result<isize>

Reads a strict ZigZag isize. Read more