Trait align_address::Align

source ·
pub trait Align<A>: Copy {
    fn align_down(self, align: A) -> Self;
    fn align_up(self, align: A) -> Self;
    fn is_aligned(self, align: A) -> bool;
}
Expand description

An adress that can be aligned.

Required Methods§

Align address downwards.

Returns the greatest x with alignment align so that x <= addr.

Panics if the alignment is not a power of two.

Align address upwards.

Returns the smallest x with alignment align so that x >= addr.

Panics if the alignment is not a power of two or if an overflow occurs.

Checks whether the address has the demanded alignment.

Implementations on Foreign Types§

Implementors§