Trait aligned_vec::Alignment

source ·
pub trait Alignment: Copy + Seal {
    // Required methods
    fn new(align: usize, minimum_align: usize) -> Self;
    fn alignment(self, minimum_align: usize) -> usize;
}
Expand description

Trait for types that wrap an alignment value.

Required Methods§

source

fn new(align: usize, minimum_align: usize) -> Self

Takes an alignment value and a minimum valid alignment, and returns an alignment wrapper that contains a power of two alignment that is greater than minimum_align, and if possible, greater than align.

source

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

Takes a minimum valid alignment, and returns an alignment wrapper that contains a power of two alignment that is greater than minimum_align, and if possible, greater than the contained value.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Alignment for RuntimeAlign

source§

impl<const ALIGN: usize> Alignment for ConstAlign<ALIGN>