Trait pelite::util::AlignTo

source ·
pub trait AlignTo {
    type TAlign;

    fn align_to(self, align: Self::TAlign) -> Self;
    fn aligned_to(self, align: Self::TAlign) -> bool;
}
Expand description

Helper to implement generic alignment operator.

Required Associated Types

Required Methods

Aligns the given value to a multiple of the align value.

Debug asserts that align is a power of two, otherwise calculates an incorrect result.

Checks if the given value is aligned to a multiple of the align value.

Debug asserts that align is a power of two, otherwise calculates an incorrect result.

Implementations on Foreign Types

Implementors