aligned_vec

Trait 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.

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.

Implementors§

Source§

impl Alignment for RuntimeAlign

Source§

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