Skip to main content

BinaryCodec

Struct BinaryCodec 

Source
pub struct BinaryCodec<T, O> { /* private fields */ }
Expand description

Type-level unchecked binary codec for one scalar type and one byte order.

BinaryCodec is intentionally a zero-sized codec type. It exposes type-level unchecked helpers for direct hot-path use and also implements Codec for generic codec pipelines. Callers must validate buffer lengths before entering the hot path.

§Type Parameters

  • T: Scalar value type to decode from bytes and encode into bytes.
  • O: Type-level byte order marker. Multi-byte scalar implementations use BigEndian, LittleEndian, or NativeEndian. Prefer big- or little-endian formats for persistent and cross-platform data; native-endian encoding is only suitable for platform-local data. Single- byte scalar implementations accept any ByteOrderSpec marker because byte order does not affect one-byte values.

§Examples

use qubit_codec::BigEndian;
use qubit_codec_binary::BinaryCodec;

let mut output = [0_u8; BinaryCodec::<u32, BigEndian>::MAX_ENCODE_UNITS_PER_VALUE];
let written = unsafe {
    BinaryCodec::<u32, BigEndian>::encode(0x0102_0304, &mut output, 0)
};
assert_eq!(4, written);
assert_eq!([1, 2, 3, 4], output);

let (decoded, consumed) = unsafe {
    BinaryCodec::<u32, BigEndian>::decode(&output, 0)
};
assert_eq!(0x0102_0304, decoded);
assert_eq!(4, consumed.get());

Byte-order markers are also required for single-byte codecs, even though the marker has no effect on the encoded bytes:

ⓘ
use qubit_codec_binary::{BinaryCodec, Strict};

let mut output = [0_u8; 1];
let _ = unsafe { BinaryCodec::<u8, Strict>::encode(1, &mut output, 0) };

Implementations§

Source§

impl<O> BinaryCodec<u8, O>
where O: ByteOrderSpec,

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (u8, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

§Parameters
  • input: Source byte buffer.
  • input_index: Start index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that input.as_ptr().add(input_index) is valid to read Self::MIN_UNITS_PER_VALUE bytes.

Source

pub unsafe fn encode(value: u8, output: &mut [u8], output_index: usize) -> usize

Encodes value into output starting at output_index without bounds checks.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that output.as_mut_ptr().add(output_index) is valid to write Self::MAX_ENCODE_UNITS_PER_VALUE bytes.

Source§

impl<O> BinaryCodec<i8, O>
where O: ByteOrderSpec,

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (i8, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

§Parameters
  • input: Source byte buffer.
  • input_index: Start index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that input.as_ptr().add(input_index) is valid to read Self::MIN_UNITS_PER_VALUE bytes.

Source

pub unsafe fn encode(value: i8, output: &mut [u8], output_index: usize) -> usize

Encodes value into output starting at output_index without bounds checks.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that output.as_mut_ptr().add(output_index) is valid to write Self::MAX_ENCODE_UNITS_PER_VALUE bytes.

Source§

impl BinaryCodec<u16, BigEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (u16, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: u16, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<u16, LittleEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (u16, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: u16, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<u32, BigEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (u32, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: u32, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<u32, LittleEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (u32, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: u32, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<u64, BigEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (u64, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: u64, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<u64, LittleEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (u64, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: u64, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<u128, BigEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (u128, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: u128, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<u128, LittleEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (u128, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: u128, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<i16, BigEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (i16, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: i16, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<i16, LittleEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (i16, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: i16, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<i32, BigEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (i32, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: i32, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<i32, LittleEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (i32, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: i32, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<i64, BigEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (i64, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: i64, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<i64, LittleEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (i64, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: i64, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<i128, BigEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (i128, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: i128, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<i128, LittleEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (i128, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: i128, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<f32, BigEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (f32, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded floating-point value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: f32, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Floating-point value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<f32, LittleEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (f32, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded floating-point value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: f32, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Floating-point value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<f64, BigEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (f64, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded floating-point value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: f64, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Floating-point value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<f64, LittleEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (f64, NonZeroUsize)

Decodes a value from input starting at input_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • input: Source byte buffer.
  • input_index: Start byte index in input.
§Returns

Returns the decoded floating-point value and the non-zero number of consumed bytes.

§Safety

The caller must guarantee that:

  • input_index + Self::MIN_UNITS_PER_VALUE <= input.len()
  • input[input_index..input_index + Self::MIN_UNITS_PER_VALUE] is valid for reading.
Source

pub unsafe fn encode( value: f64, output: &mut [u8], output_index: usize, ) -> usize

Encodes value into output starting at output_index without bounds checks.

This function is intended for hot binary codec paths where the caller has already validated the buffer length externally.

§Parameters
  • value: Floating-point value to encode.
  • output: Destination byte buffer.
  • output_index: Start byte index in output.
§Returns

Returns the number of bytes written, equal to Self::MAX_ENCODE_UNITS_PER_VALUE, independently of output_index. The next output position is output_index + written, where written is the returned byte count.

§Safety

The caller must guarantee that:

  • output_index + Self::MAX_ENCODE_UNITS_PER_VALUE <= output.len()
  • output[output_index..output_index + Self::MAX_ENCODE_UNITS_PER_VALUE] is valid for writing.
Source§

impl BinaryCodec<u16, NativeEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (u16, NonZeroUsize)

Decodes a native-endian value without bounds checks.

§Parameters
  • input: Byte slice containing the encoded value.
  • input_index: Absolute byte index where decoding starts.
§Returns

Returns the decoded value and the fixed number of bytes read.

§Safety

The caller must guarantee that at least Self::MIN_UNITS_PER_VALUE bytes are readable from input_index within input.

Source

pub unsafe fn encode( value: u16, output: &mut [u8], output_index: usize, ) -> usize

Encodes a native-endian value without bounds checks.

§Parameters
  • value: Value to encode.
  • output: Destination byte slice.
  • output_index: Absolute byte index where encoding starts.
§Returns

Returns the fixed number of bytes written.

§Safety

The caller must guarantee that at least Self::MAX_ENCODE_UNITS_PER_VALUE bytes are writable from output_index within output.

Source§

impl BinaryCodec<u32, NativeEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (u32, NonZeroUsize)

Decodes a native-endian value without bounds checks.

§Parameters
  • input: Byte slice containing the encoded value.
  • input_index: Absolute byte index where decoding starts.
§Returns

Returns the decoded value and the fixed number of bytes read.

§Safety

The caller must guarantee that at least Self::MIN_UNITS_PER_VALUE bytes are readable from input_index within input.

Source

pub unsafe fn encode( value: u32, output: &mut [u8], output_index: usize, ) -> usize

Encodes a native-endian value without bounds checks.

§Parameters
  • value: Value to encode.
  • output: Destination byte slice.
  • output_index: Absolute byte index where encoding starts.
§Returns

Returns the fixed number of bytes written.

§Safety

The caller must guarantee that at least Self::MAX_ENCODE_UNITS_PER_VALUE bytes are writable from output_index within output.

Source§

impl BinaryCodec<u64, NativeEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (u64, NonZeroUsize)

Decodes a native-endian value without bounds checks.

§Parameters
  • input: Byte slice containing the encoded value.
  • input_index: Absolute byte index where decoding starts.
§Returns

Returns the decoded value and the fixed number of bytes read.

§Safety

The caller must guarantee that at least Self::MIN_UNITS_PER_VALUE bytes are readable from input_index within input.

Source

pub unsafe fn encode( value: u64, output: &mut [u8], output_index: usize, ) -> usize

Encodes a native-endian value without bounds checks.

§Parameters
  • value: Value to encode.
  • output: Destination byte slice.
  • output_index: Absolute byte index where encoding starts.
§Returns

Returns the fixed number of bytes written.

§Safety

The caller must guarantee that at least Self::MAX_ENCODE_UNITS_PER_VALUE bytes are writable from output_index within output.

Source§

impl BinaryCodec<u128, NativeEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (u128, NonZeroUsize)

Decodes a native-endian value without bounds checks.

§Parameters
  • input: Byte slice containing the encoded value.
  • input_index: Absolute byte index where decoding starts.
§Returns

Returns the decoded value and the fixed number of bytes read.

§Safety

The caller must guarantee that at least Self::MIN_UNITS_PER_VALUE bytes are readable from input_index within input.

Source

pub unsafe fn encode( value: u128, output: &mut [u8], output_index: usize, ) -> usize

Encodes a native-endian value without bounds checks.

§Parameters
  • value: Value to encode.
  • output: Destination byte slice.
  • output_index: Absolute byte index where encoding starts.
§Returns

Returns the fixed number of bytes written.

§Safety

The caller must guarantee that at least Self::MAX_ENCODE_UNITS_PER_VALUE bytes are writable from output_index within output.

Source§

impl BinaryCodec<i16, NativeEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (i16, NonZeroUsize)

Decodes a native-endian value without bounds checks.

§Parameters
  • input: Byte slice containing the encoded value.
  • input_index: Absolute byte index where decoding starts.
§Returns

Returns the decoded value and the fixed number of bytes read.

§Safety

The caller must guarantee that at least Self::MIN_UNITS_PER_VALUE bytes are readable from input_index within input.

Source

pub unsafe fn encode( value: i16, output: &mut [u8], output_index: usize, ) -> usize

Encodes a native-endian value without bounds checks.

§Parameters
  • value: Value to encode.
  • output: Destination byte slice.
  • output_index: Absolute byte index where encoding starts.
§Returns

Returns the fixed number of bytes written.

§Safety

The caller must guarantee that at least Self::MAX_ENCODE_UNITS_PER_VALUE bytes are writable from output_index within output.

Source§

impl BinaryCodec<i32, NativeEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (i32, NonZeroUsize)

Decodes a native-endian value without bounds checks.

§Parameters
  • input: Byte slice containing the encoded value.
  • input_index: Absolute byte index where decoding starts.
§Returns

Returns the decoded value and the fixed number of bytes read.

§Safety

The caller must guarantee that at least Self::MIN_UNITS_PER_VALUE bytes are readable from input_index within input.

Source

pub unsafe fn encode( value: i32, output: &mut [u8], output_index: usize, ) -> usize

Encodes a native-endian value without bounds checks.

§Parameters
  • value: Value to encode.
  • output: Destination byte slice.
  • output_index: Absolute byte index where encoding starts.
§Returns

Returns the fixed number of bytes written.

§Safety

The caller must guarantee that at least Self::MAX_ENCODE_UNITS_PER_VALUE bytes are writable from output_index within output.

Source§

impl BinaryCodec<i64, NativeEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (i64, NonZeroUsize)

Decodes a native-endian value without bounds checks.

§Parameters
  • input: Byte slice containing the encoded value.
  • input_index: Absolute byte index where decoding starts.
§Returns

Returns the decoded value and the fixed number of bytes read.

§Safety

The caller must guarantee that at least Self::MIN_UNITS_PER_VALUE bytes are readable from input_index within input.

Source

pub unsafe fn encode( value: i64, output: &mut [u8], output_index: usize, ) -> usize

Encodes a native-endian value without bounds checks.

§Parameters
  • value: Value to encode.
  • output: Destination byte slice.
  • output_index: Absolute byte index where encoding starts.
§Returns

Returns the fixed number of bytes written.

§Safety

The caller must guarantee that at least Self::MAX_ENCODE_UNITS_PER_VALUE bytes are writable from output_index within output.

Source§

impl BinaryCodec<i128, NativeEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (i128, NonZeroUsize)

Decodes a native-endian value without bounds checks.

§Parameters
  • input: Byte slice containing the encoded value.
  • input_index: Absolute byte index where decoding starts.
§Returns

Returns the decoded value and the fixed number of bytes read.

§Safety

The caller must guarantee that at least Self::MIN_UNITS_PER_VALUE bytes are readable from input_index within input.

Source

pub unsafe fn encode( value: i128, output: &mut [u8], output_index: usize, ) -> usize

Encodes a native-endian value without bounds checks.

§Parameters
  • value: Value to encode.
  • output: Destination byte slice.
  • output_index: Absolute byte index where encoding starts.
§Returns

Returns the fixed number of bytes written.

§Safety

The caller must guarantee that at least Self::MAX_ENCODE_UNITS_PER_VALUE bytes are writable from output_index within output.

Source§

impl BinaryCodec<f32, NativeEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (f32, NonZeroUsize)

Decodes a native-endian floating-point value without bounds checks.

§Parameters
  • input: Byte slice containing the encoded value.
  • input_index: Absolute byte index where decoding starts.
§Returns

Returns the decoded floating-point value and fixed byte count.

§Safety

The caller must guarantee that at least Self::MIN_UNITS_PER_VALUE bytes are readable from input_index within input.

Source

pub unsafe fn encode( value: f32, output: &mut [u8], output_index: usize, ) -> usize

Encodes a native-endian floating-point value without bounds checks.

§Parameters
  • value: Floating-point value to encode.
  • output: Destination byte slice.
  • output_index: Absolute byte index where encoding starts.
§Returns

Returns the fixed number of bytes written.

§Safety

The caller must guarantee that at least Self::MAX_ENCODE_UNITS_PER_VALUE bytes are writable from output_index within output.

Source§

impl BinaryCodec<f64, NativeEndian>

Source

pub const MIN_UNITS_PER_VALUE: usize = <Self as Codec>::MIN_UNITS_PER_VALUE

Minimum number of bytes required to encode or decode this type.

Source

pub const MAX_ENCODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_ENCODE_UNITS_PER_VALUE

Maximum number of bytes emitted when encoding this type.

Source

pub const MAX_DECODE_UNITS_PER_VALUE: usize = <Self as Codec>::MAX_DECODE_UNITS_PER_VALUE

Maximum number of bytes consumed when decoding this type.

Source

pub unsafe fn decode(input: &[u8], input_index: usize) -> (f64, NonZeroUsize)

Decodes a native-endian floating-point value without bounds checks.

§Parameters
  • input: Byte slice containing the encoded value.
  • input_index: Absolute byte index where decoding starts.
§Returns

Returns the decoded floating-point value and fixed byte count.

§Safety

The caller must guarantee that at least Self::MIN_UNITS_PER_VALUE bytes are readable from input_index within input.

Source

pub unsafe fn encode( value: f64, output: &mut [u8], output_index: usize, ) -> usize

Encodes a native-endian floating-point value without bounds checks.

§Parameters
  • value: Floating-point value to encode.
  • output: Destination byte slice.
  • output_index: Absolute byte index where encoding starts.
§Returns

Returns the fixed number of bytes written.

§Safety

The caller must guarantee that at least Self::MAX_ENCODE_UNITS_PER_VALUE bytes are writable from output_index within output.

Trait Implementations§

Source§

impl<T: Clone, O: Clone> Clone for BinaryCodec<T, O>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<O> Codec for BinaryCodec<u8, O>
where O: ByteOrderSpec,

Source§

type Value = u8

Logical unsigned byte decoded from or encoded into the unit buffer.

Source§

type Unit = u8

One byte used as both the input and output unit.

Source§

type DecodeError = !

Decoding a byte cannot fail after the caller satisfies the safety contract.

Source§

type EncodeError = !

Encoding a byte cannot fail after the caller satisfies the safety contract.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(u8, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one byte from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index of the byte to decode.
§Returns

Returns the decoded byte and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions; the input must contain the byte at input_index.

Source§

unsafe fn encode( &mut self, value: &u8, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one byte into the supplied output slice.

§Parameters
  • value: Byte value to encode.
  • output: Destination byte buffer.
  • output_index: Index where the encoded byte is written.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions; the output must have space at output_index.

Source§

const MIN_UNITS_PER_VALUE: usize = 1

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 1

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 1

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl<O> Codec for BinaryCodec<i8, O>
where O: ByteOrderSpec,

Source§

type Value = i8

Logical signed byte decoded from or encoded into the unit buffer.

Source§

type Unit = u8

One byte used as both the input and output unit.

Source§

type DecodeError = !

Decoding a byte cannot fail after the caller satisfies the safety contract.

Source§

type EncodeError = !

Encoding a byte cannot fail after the caller satisfies the safety contract.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(i8, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one signed byte from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index of the byte to decode.
§Returns

Returns the decoded signed byte and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions; the input must contain the byte at input_index.

Source§

unsafe fn encode( &mut self, value: &i8, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one signed byte into the supplied output slice.

§Parameters
  • value: Signed byte value to encode.
  • output: Destination byte buffer.
  • output_index: Index where the encoded byte is written.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions; the output must have space at output_index.

Source§

const MIN_UNITS_PER_VALUE: usize = 1

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 1

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 1

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<u16, BigEndian>

Source§

type Value = u16

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(u16, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &u16, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 2

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 2

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 2

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<u16, LittleEndian>

Source§

type Value = u16

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(u16, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &u16, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 2

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 2

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 2

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<u32, BigEndian>

Source§

type Value = u32

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(u32, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &u32, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 4

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 4

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 4

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<u32, LittleEndian>

Source§

type Value = u32

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(u32, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &u32, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 4

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 4

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 4

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<u64, BigEndian>

Source§

type Value = u64

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(u64, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &u64, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 8

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 8

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 8

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<u64, LittleEndian>

Source§

type Value = u64

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(u64, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &u64, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 8

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 8

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 8

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<u128, BigEndian>

Source§

type Value = u128

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(u128, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &u128, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 16

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 16

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 16

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<u128, LittleEndian>

Source§

type Value = u128

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(u128, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &u128, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 16

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 16

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 16

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<i16, BigEndian>

Source§

type Value = i16

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(i16, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &i16, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 2

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 2

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 2

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<i16, LittleEndian>

Source§

type Value = i16

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(i16, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &i16, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 2

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 2

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 2

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<i32, BigEndian>

Source§

type Value = i32

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(i32, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &i32, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 4

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 4

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 4

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<i32, LittleEndian>

Source§

type Value = i32

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(i32, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &i32, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 4

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 4

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 4

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<i64, BigEndian>

Source§

type Value = i64

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(i64, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &i64, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 8

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 8

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 8

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<i64, LittleEndian>

Source§

type Value = i64

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(i64, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &i64, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 8

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 8

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 8

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<i128, BigEndian>

Source§

type Value = i128

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(i128, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &i128, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 16

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 16

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 16

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<i128, LittleEndian>

Source§

type Value = i128

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(i128, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &i128, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 16

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 16

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 16

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<f32, BigEndian>

Source§

type Value = f32

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(f32, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &f32, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 4

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 4

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 4

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<f32, LittleEndian>

Source§

type Value = f32

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(f32, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &f32, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 4

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 4

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 4

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<f64, BigEndian>

Source§

type Value = f64

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(f64, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &f64, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 8

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 8

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 8

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<f64, LittleEndian>

Source§

type Value = f64

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(f64, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &f64, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 8

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 8

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 8

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<u16, NativeEndian>

Source§

type Value = u16

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(u16, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &u16, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 2

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 2

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 2

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<u32, NativeEndian>

Source§

type Value = u32

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(u32, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &u32, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 4

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 4

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 4

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<u64, NativeEndian>

Source§

type Value = u64

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(u64, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &u64, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 8

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 8

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 8

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<u128, NativeEndian>

Source§

type Value = u128

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(u128, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &u128, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 16

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 16

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 16

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<i16, NativeEndian>

Source§

type Value = i16

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(i16, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &i16, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 2

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 2

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 2

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<i32, NativeEndian>

Source§

type Value = i32

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(i32, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &i32, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 4

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 4

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 4

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<i64, NativeEndian>

Source§

type Value = i64

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(i64, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &i64, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 8

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 8

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 8

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<i128, NativeEndian>

Source§

type Value = i128

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(i128, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &i128, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 16

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 16

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 16

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<f32, NativeEndian>

Source§

type Value = f32

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(f32, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &f32, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 4

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 4

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 4

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl Codec for BinaryCodec<f64, NativeEndian>

Source§

type Value = f64

The scalar value represented by this codec implementation.

Source§

type Unit = u8

One byte of the encoded representation.

Source§

type DecodeError = !

Decoding cannot fail after the buffer preconditions are met.

Source§

type EncodeError = !

Encoding cannot fail after the buffer preconditions are met.

Source§

unsafe fn decode( &mut self, input: &[u8], input_index: usize, ) -> Result<(f64, NonZeroUsize), DecodeFailure<Self::DecodeError>>

Decodes one scalar value from the supplied input slice.

§Parameters
  • input: Source byte buffer.
  • input_index: Index where decoding starts.
§Returns

Returns the decoded scalar and the number of bytes consumed.

§Safety

The caller must satisfy the Codec::decode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

unsafe fn encode( &mut self, value: &f64, output: &mut [u8], output_index: usize, ) -> Result<usize, Self::EncodeError>

Encodes one scalar value into the supplied output slice.

§Parameters
  • value: Scalar value to encode.
  • output: Destination byte buffer.
  • output_index: Index where encoding starts.
§Returns

Returns the number of bytes written.

§Safety

The caller must satisfy the Codec::encode buffer and index preconditions for this scalar’s fixed encoded width.

Source§

const MIN_UNITS_PER_VALUE: usize = 8

The minimum possible non-zero readable unit count for one decoded value. Read more
Source§

const MAX_ENCODE_UNITS_PER_VALUE: usize = 8

The maximum unit count emitted when encoding one value. Read more
Source§

const MAX_DECODE_UNITS_PER_VALUE: usize = 8

The maximum non-zero unit count consumed to decode one value. Read more
Source§

const MAX_ENCODE_RESET_UNITS: usize = 0

The maximum unit count emitted when resetting encode state. Read more
Source§

const MAX_ENCODE_FINISH_UNITS: usize = 0

The maximum unit count emitted when finishing encode state at EOF. Read more
Source§

const MAX_DECODE_RESET_VALUES: usize = 0

The maximum value count emitted when resetting decode state. Read more
Source§

const MAX_DECODE_FINISH_VALUES: usize = 0

The maximum value count emitted when finishing decode state. Read more
Source§

fn can_encode_value(&self, _value: &Self::Value) -> bool

Returns whether value is in this codec’s encodable value domain. Read more
Source§

fn encode_len(&self, _value: &Self::Value) -> usize

Returns the exact unit count this codec will write when encoding value. Read more
Source§

unsafe fn encode_reset( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits stream-start output and resets encode-side state. Read more
Source§

unsafe fn encode_finish( &mut self, _output: &mut [Self::Unit], _output_index: usize, ) -> Result<usize, Self::EncodeError>

Emits EOF trailer output and finishes encode-side state. Read more
Source§

unsafe fn decode_reset( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Emits stream-start values and resets decode-side state. Read more
Source§

unsafe fn decode_eof( &mut self, input: &[Self::Unit], input_index: usize, ) -> Result<(Self::Value, NonZero<usize>), DecodeFailure<Self::DecodeError>>

Decodes one value after the caller has established end of input. Read more
Source§

unsafe fn decode_finish( &mut self, _output: &mut [Self::Value], _output_index: usize, ) -> Result<usize, Self::DecodeError>

Finishes decode-side EOF state into output. Read more
Source§

impl<T: Copy, O: Copy> Copy for BinaryCodec<T, O>

Source§

impl<T: Debug, O: Debug> Debug for BinaryCodec<T, O>

Source§

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

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

impl<T: Default, O: Default> Default for BinaryCodec<T, O>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T: Eq, O: Eq> Eq for BinaryCodec<T, O>

Source§

impl<T: Hash, O: Hash> Hash for BinaryCodec<T, O>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: PartialEq, O: PartialEq> PartialEq for BinaryCodec<T, O>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<T: PartialEq, O: PartialEq> StructuralPartialEq for BinaryCodec<T, O>

Auto Trait Implementations§

§

impl<T, O> Forget for BinaryCodec<T, O>

§

impl<T, O> Freeze for BinaryCodec<T, O>
where PhantomData<fn() -> (T, O)>: Freeze,

§

impl<T, O> Move for BinaryCodec<T, O>

§

impl<T, O> RefUnwindSafe for BinaryCodec<T, O>

§

impl<T, O> Send for BinaryCodec<T, O>
where PhantomData<fn() -> (T, O)>: Send,

§

impl<T, O> Sync for BinaryCodec<T, O>
where PhantomData<fn() -> (T, O)>: Sync,

§

impl<T, O> Unpin for BinaryCodec<T, O>
where PhantomData<fn() -> (T, O)>: Unpin,

§

impl<T, O> UnsafeUnpin for BinaryCodec<T, O>

§

impl<T, O> UnwindSafe for BinaryCodec<T, O>

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> 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<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 = !

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

fn try_from(value: U) -> Result<T, !>

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.