AlignTo

Trait AlignTo 

pub trait AlignTo: Copy {
    // Required method
    fn align_to(self, alignment: Self) -> Self;
}
Expand description

Trait for adjusting integers to the next multiple of an alignment.

Required Methods§

fn align_to(self, alignment: Self) -> Self

Aligns self to alignment.

Panics if doing so would overflow.

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.

Implementations on Foreign Types§

§

impl AlignTo for u32

§

fn align_to(self, alignment: u32) -> u32

§

impl AlignTo for u64

§

fn align_to(self, alignment: u64) -> u64

§

impl AlignTo for usize

§

fn align_to(self, alignment: usize) -> usize

Implementors§