Skip to main content

ZigZagReadExt

Trait ZigZagReadExt 

Source
pub trait ZigZagReadExt: Input<Item = u8> {
    // Provided methods
    fn read_zig_zag_i8_non_strict(&mut self) -> Result<i8> { ... }
    fn read_zig_zag_i8_strict(&mut self) -> Result<i8> { ... }
    fn read_zig_zag_i16_non_strict(&mut self) -> Result<i16> { ... }
    fn read_zig_zag_i16_strict(&mut self) -> Result<i16> { ... }
    fn read_zig_zag_i32_non_strict(&mut self) -> Result<i32> { ... }
    fn read_zig_zag_i32_strict(&mut self) -> Result<i32> { ... }
    fn read_zig_zag_i64_non_strict(&mut self) -> Result<i64> { ... }
    fn read_zig_zag_i64_strict(&mut self) -> Result<i64> { ... }
    fn read_zig_zag_i128_non_strict(&mut self) -> Result<i128> { ... }
    fn read_zig_zag_i128_strict(&mut self) -> Result<i128> { ... }
    fn read_zig_zag_isize_non_strict(&mut self) -> Result<isize> { ... }
    fn read_zig_zag_isize_strict(&mut self) -> Result<isize> { ... }
}
Expand description

Extension methods for reading ZigZag + unsigned LEB128 integers.

§Target-width integers

isize methods use the current Rust target’s pointer width. Prefer fixed-width integer methods such as Self::read_zig_zag_i64_non_strict for persistent files and cross-platform protocols. Non-strict methods use the _non_strict suffix; canonical-only methods use the corresponding _strict suffix.

Provided Methods§

Source

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

Reads a non-strict ZigZag i8.

§Returns

Returns the decoded integer.

§Errors

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

Source

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

Reads a strict ZigZag i8.

§Returns

Returns the decoded integer.

§Errors

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

Source

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

Reads a non-strict ZigZag i16.

§Returns

Returns the decoded integer.

§Errors

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

Source

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

Reads a strict ZigZag i16.

§Returns

Returns the decoded integer.

§Errors

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

Source

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

Reads a non-strict ZigZag i32.

§Returns

Returns the decoded integer.

§Errors

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

Source

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

Reads a strict ZigZag i32.

§Returns

Returns the decoded integer.

§Errors

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

Source

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

Reads a non-strict ZigZag i64.

§Returns

Returns the decoded integer.

§Errors

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

Source

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

Reads a strict ZigZag i64.

§Returns

Returns the decoded integer.

§Errors

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

Source

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

Reads a non-strict ZigZag i128.

§Returns

Returns the decoded integer.

§Errors

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

Source

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

Reads a strict ZigZag i128.

§Returns

Returns the decoded integer.

§Errors

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

Source

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

Reads a non-strict ZigZag isize.

§Returns

Returns the decoded integer.

§Errors

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

Source

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

Reads a strict ZigZag isize.

§Returns

Returns the decoded integer.

§Errors

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

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