Trait StandardPadding

Source
pub trait StandardPadding {
    // Required method
    fn pad<F: FnMut(&[u8])>(&mut self, padding: u8, rem: usize, func: F);

    // Provided method
    fn standard_padding<F: FnMut(&[u8])>(&mut self, rem: usize, func: F) { ... }
}
Expand description

The StandardPadding trait adds a method useful for various hash algorithms to a FixedBuffer struct.

Required Methods§

Source

fn pad<F: FnMut(&[u8])>(&mut self, padding: u8, rem: usize, func: F)

Add standard padding to the buffer. The buffer must not be full when this method is called and is guaranteed to have exactly rem remaining bytes when it returns. If there are not at least rem bytes available, the buffer will be zero padded, processed, cleared, and then filled with zeros again until only rem bytes are remaining.

Provided Methods§

Source

fn standard_padding<F: FnMut(&[u8])>(&mut self, rem: usize, func: F)

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§