Trait rarena_allocator::checksum::BuildChecksumer

source ·
pub trait BuildChecksumer {
    type Checksumer: Checksumer;

    // Required methods
    fn build_checksumer(&self) -> Self::Checksumer;
    fn checksum_one(&self, src: &[u8]) -> u64;
}
Expand description

A trait for creating instances of Checksumer.

A BuildChecksumer is typically used to create Checksumers.

For each instance of BuildChecksumer, the Checksumers created by [build_checksumer] should be identical. That is, if the same stream of bytes is fed into each checksumer, the same output will also be generated.

Required Associated Types§

source

type Checksumer: Checksumer

Type of the checksumer that will be created.

Required Methods§

source

fn build_checksumer(&self) -> Self::Checksumer

Creates a new checksumer.

Each call to build_checksumer on the same instance should produce identical Checksumers.

§Examples
use dbutils::checksum::{BuildChecksumer, Crc32};

let s = Crc32::new();
let new_s = s.build_checksumer();
source

fn checksum_one(&self, src: &[u8]) -> u64

Calculates the checksum of a byte slice.

Implementors§