Skip to main content

BlockSizeSpec

Trait BlockSizeSpec 

Source
pub trait BlockSizeSpec:
    Copy
    + Clone
    + Debug
    + Eq
    + PartialEq {
    // Required methods
    fn size(self) -> u64;
    fn mask(self) -> u64;
    fn shift(self) -> u32;
}
Expand description

Defines the block size specification for use with GenericBlockSize. Only block sizes which are a power of 2 are supported.

Required Methods§

Source

fn size(self) -> u64

Returns the block size in bytes (e.g. 4096 for 4096-byte blocks).

Source

fn mask(self) -> u64

Returns the bitmask corresponding to size - 1 (e.g. 4095 for 4096-byte blocks).

Source

fn shift(self) -> u32

Returns the power-of-two bit shift (e.g. 12 for 4096-byte blocks).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§