pub trait AlignOps: UsizeConvert {
// Provided methods
fn is_aligned(self, alignment: usize) -> bool { ... }
fn is_page_aligned(self) -> bool { ... }
fn align_up(self, alignment: usize) -> Self { ... }
fn align_down(self, alignment: usize) -> Self { ... }
fn align_up_to_page(self) -> Self { ... }
fn align_down_to_page(self) -> Self { ... }
}Provided Methods§
Sourcefn is_aligned(self, alignment: usize) -> bool
fn is_aligned(self, alignment: usize) -> bool
Sourcefn is_page_aligned(self) -> bool
fn is_page_aligned(self) -> bool
检查地址是否已页对齐(对齐到 PAGE_SIZE)。
Sourcefn align_down(self, alignment: usize) -> Self
fn align_down(self, alignment: usize) -> Self
Sourcefn align_up_to_page(self) -> Self
fn align_up_to_page(self) -> Self
将地址向上对齐到页大小(PAGE_SIZE)。
Sourcefn align_down_to_page(self) -> Self
fn align_down_to_page(self) -> Self
将地址向下对齐到页大小(PAGE_SIZE)。
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.