AlignTo

Trait AlignTo 

Source
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§

Source

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§

Source§

impl AlignTo for u32

Source§

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

Source§

impl AlignTo for u64

Source§

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

Source§

impl AlignTo for usize

Source§

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

Implementors§