pub struct Alignment(/* private fields */);Expand description
Contains the alignment memory can have.
§Example
use iceoryx2_bb_elementary::alignment::Alignment;
let my_alignment = Alignment::new(32).unwrap();
// zero is not a valid alignment
let broken_alignment = Alignment::new(0);
assert_eq!(broken_alignment, None);
// alignment must be a power of 2
let broken_alignment = Alignment::new(89);
assert_eq!(broken_alignment, None);Implementations§
Source§impl Alignment
impl Alignment
pub const ALIGN_1: Alignment
pub const ALIGN_2: Alignment
pub const ALIGN_4: Alignment
pub const ALIGN_8: Alignment
pub const ALIGN_16: Alignment
pub const ALIGN_32: Alignment
pub const ALIGN_64: Alignment
pub const ALIGN_128: Alignment
pub const ALIGN_256: Alignment
pub const ALIGN_512: Alignment
pub const ALIGN_1024: Alignment
pub const ALIGN_2048: Alignment
pub const ALIGN_4096: Alignment
Sourcepub const unsafe fn new_unchecked(value: usize) -> Self
pub const unsafe fn new_unchecked(value: usize) -> Self
Trait Implementations§
impl Copy for Alignment
impl Eq for Alignment
impl StructuralPartialEq for Alignment
Auto Trait Implementations§
impl Freeze for Alignment
impl RefUnwindSafe for Alignment
impl Send for Alignment
impl Sync for Alignment
impl Unpin for Alignment
impl UnwindSafe for Alignment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more