[][src]Trait pelite::util::AlignTo

pub trait AlignTo {
    type TAlign;
    fn align_to(self, align: Self::TAlign) -> Self;
fn aligned_to(self, align: Self::TAlign) -> bool; }

Helper to implement generic alignment operator.

Associated Types

type TAlign

Loading content...

Required methods

fn align_to(self, align: Self::TAlign) -> Self

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.

fn aligned_to(self, align: Self::TAlign) -> bool

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.

Loading content...

Implementations on Foreign Types

impl AlignTo for u8[src]

type TAlign = u8

impl AlignTo for u16[src]

type TAlign = u16

impl AlignTo for u32[src]

type TAlign = u32

impl AlignTo for u64[src]

type TAlign = u64

impl AlignTo for u128[src]

type TAlign = u128

impl AlignTo for usize[src]

type TAlign = usize

impl<T> AlignTo for *const T[src]

type TAlign = usize

impl<T> AlignTo for *mut T[src]

type TAlign = usize

Loading content...

Implementors

Loading content...