pub trait SizeConstants {
Show 32 associated constants and 0 method
const SZ_1: Self;
const SZ_2: Self;
const SZ_4: Self;
const SZ_8: Self;
const SZ_16: Self;
const SZ_32: Self;
const SZ_64: Self;
const SZ_128: Self;
const SZ_256: Self;
const SZ_512: Self;
const SZ_1K: Self;
const SZ_2K: Self;
const SZ_4K: Self;
const SZ_8K: Self;
const SZ_16K: Self;
const SZ_32K: Self;
const SZ_64K: Self;
const SZ_128K: Self;
const SZ_256K: Self;
const SZ_512K: Self;
const SZ_1M: Self;
const SZ_2M: Self;
const SZ_4M: Self;
const SZ_8M: Self;
const SZ_16M: Self;
const SZ_32M: Self;
const SZ_64M: Self;
const SZ_128M: Self;
const SZ_256M: Self;
const SZ_512M: Self;
const SZ_1G: Self;
const SZ_2G: Self;
}Expand description
Size constants for device address spaces.
Implemented for u32, u64, and usize so drivers can
choose the width that matches their hardware. All SZ_* values fit
in a u32, so all implementations are lossless.
Also implemented for Alignment, providing each size as a
compile-time validated alignment.
§Examples
use kernel::{
ptr::Alignment,
sizes::SizeConstants, //
};
let gpu_heap = 14 * u64::SZ_1M;
let mmio_window = u32::SZ_16M;
let page_align = Alignment::SZ_4K;Required Associated Constants§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".