PageSize

Trait PageSize 

Source
pub trait PageSize:
    Sealed
    + Clone
    + Copy
    + Eq
    + PartialEq
    + Ord
    + PartialOrd
    + Hash {
    const SIZE: u64;
    const SHIFT: u32;
}
Expand description

Marker trait for supported page sizes.

Required Associated Constants§

Source

const SIZE: u64

Page size in bytes (power of two).

Source

const SHIFT: u32

log2(SIZE), i.e., number of low bits used for the offset.

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 PageSize for Size1G

Source§

const SIZE: u64 = 1_073_741_824u64

Source§

const SHIFT: u32 = 30u32

Source§

impl PageSize for Size2M

Source§

const SIZE: u64 = 2_097_152u64

Source§

const SHIFT: u32 = 21u32

Source§

impl PageSize for Size4K

Source§

const SIZE: u64 = 4_096u64

Source§

const SHIFT: u32 = 12u32