Trait EndianInput

Source
pub trait EndianInput: Input {
    type ByteOrder: ByteOrder;

Show 20 methods // Provided methods fn input_u8(&mut self, n: u8) { ... } fn input_i8(&mut self, n: i8) { ... } fn chain_u8(self, n: u8) -> Self where Self: Sized { ... } fn chain_i8(self, n: i8) -> Self where Self: Sized { ... } fn input_u16(&mut self, n: u16) { ... } fn chain_u16(self, n: u16) -> Self where Self: Sized { ... } fn input_i16(&mut self, n: i16) { ... } fn chain_i16(self, n: i16) -> Self where Self: Sized { ... } fn input_u32(&mut self, n: u32) { ... } fn chain_u32(self, n: u32) -> Self where Self: Sized { ... } fn input_i32(&mut self, n: i32) { ... } fn chain_i32(self, n: i32) -> Self where Self: Sized { ... } fn input_u64(&mut self, n: u64) { ... } fn chain_u64(self, n: u64) -> Self where Self: Sized { ... } fn input_i64(&mut self, n: i64) { ... } fn chain_i64(self, n: i64) -> Self where Self: Sized { ... } fn input_f32(&mut self, n: f32) { ... } fn chain_f32(self, n: f32) -> Self where Self: Sized { ... } fn input_f64(&mut self, n: f64) { ... } fn chain_f64(self, n: f64) -> Self where Self: Sized { ... }
}
Expand description

Extends digest::Input to provide primitives for type-safe hashing.

EndianInput provides methods to process machine-independent values of bit widths larger than 8 bit. The values are serialized with the byte order which is defined in the associated type ByteOrder.

Required Associated Types§

Source

type ByteOrder: ByteOrder

The byte order this implementation provides.

This type binding determines the “endianness” of how integer and floating-point values are serialized by this implementation towards computation of the digest.

Provided Methods§

Source

fn input_u8(&mut self, n: u8)

Feeds an unsigned 8-bit value into the digest function.

This method is agnostic to the byte order, and is only provided for completeness.

Source

fn input_i8(&mut self, n: i8)

Feeds a signed 8-bit value into the digest function.

This method is agnostic to the byte order, and is only provided for completeness.

Source

fn chain_u8(self, n: u8) -> Self
where Self: Sized,

Digest an unsigned 8-bit value in a chained manner.

This method is agnostic to the byte order, and is only provided for completeness.

Source

fn chain_i8(self, n: i8) -> Self
where Self: Sized,

Digest a signed 8-bit value in a chained manner.

This method is agnostic to the byte order, and is only provided for completeness.

Source

fn input_u16(&mut self, n: u16)

Source

fn chain_u16(self, n: u16) -> Self
where Self: Sized,

Source

fn input_i16(&mut self, n: i16)

Source

fn chain_i16(self, n: i16) -> Self
where Self: Sized,

Source

fn input_u32(&mut self, n: u32)

Source

fn chain_u32(self, n: u32) -> Self
where Self: Sized,

Source

fn input_i32(&mut self, n: i32)

Source

fn chain_i32(self, n: i32) -> Self
where Self: Sized,

Source

fn input_u64(&mut self, n: u64)

Source

fn chain_u64(self, n: u64) -> Self
where Self: Sized,

Source

fn input_i64(&mut self, n: i64)

Source

fn chain_i64(self, n: i64) -> Self
where Self: Sized,

Source

fn input_f32(&mut self, n: f32)

Source

fn chain_f32(self, n: f32) -> Self
where Self: Sized,

Source

fn input_f64(&mut self, n: f64)

Source

fn chain_f64(self, n: f64) -> Self
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<D, Bo> EndianInput for Endian<D, Bo>
where D: Input, Bo: ByteOrder,