pub struct Align(/* private fields */);
Expand description
A size efficient, opaque representation of bytewise alignment.
See Alignment.h
for LLVM’s corresponding structures.
Implementations§
Source§impl Align
impl Align
Sourcepub fn from_shift(shift: u8) -> Result<Align, AlignError>
pub fn from_shift(shift: u8) -> Result<Align, AlignError>
Create an Align
from the given shift value, returning an error if the requested
shift is invalid.
Sourcepub fn from_byte_align(byte_align: u64) -> Result<Align, AlignError>
pub fn from_byte_align(byte_align: u64) -> Result<Align, AlignError>
Create an Align
from the given byte alignment value, returning an error if the requested
shift is invalid.
Sourcepub fn from_bit_align(bit_align: u64) -> Result<Align, AlignError>
pub fn from_bit_align(bit_align: u64) -> Result<Align, AlignError>
Create an Align
from the given bit alignment value, returning an error if the requested
shift is invalid.
Sourcepub fn shift(&self) -> u8
pub fn shift(&self) -> u8
Return this alignment’s shift value, i.e. the power of two for the alignment.
Sourcepub fn byte_align(&self) -> u64
pub fn byte_align(&self) -> u64
Return this alignment as a byte-granular alignment.
Trait Implementations§
Source§impl Ord for Align
impl Ord for Align
Source§impl PartialOrd for Align
impl PartialOrd for Align
impl Copy for Align
impl Eq for Align
impl StructuralPartialEq for Align
Auto Trait Implementations§
impl Freeze for Align
impl RefUnwindSafe for Align
impl Send for Align
impl Sync for Align
impl Unpin for Align
impl UnwindSafe for Align
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