Struct rustc_target::abi::Align [−][src]
pub struct Align {
pow2: u8,
}Expand description
Alignment of a type in bytes (always a power of two).
Fields
pow2: u8Implementations
impl Align[src]
impl Align[src]pub fn from_bits(bits: u64) -> Result<Align, String>[src]
pub fn from_bytes(align: u64) -> Result<Align, String>[src]
pub fn bytes(self) -> u64[src]
pub fn bits(self) -> u64[src]
pub fn max_for_offset(offset: Size) -> Align[src]
pub fn max_for_offset(offset: Size) -> Align[src]Computes the best alignment possible for the given offset (the largest power of two that the offset is a multiple of).
N.B., for an offset of 0, this happens to return 2^64.
pub fn restrict_for_offset(self, offset: Size) -> Align[src]
pub fn restrict_for_offset(self, offset: Size) -> Align[src]Lower the alignment, if necessary, such that the given offset is aligned to it (the offset is a multiple of the alignment).
Trait Implementations
impl<__CTX> HashStable<__CTX> for Align where
__CTX: HashStableContext, [src]
impl<__CTX> HashStable<__CTX> for Align where
__CTX: HashStableContext, [src]fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)[src]
impl Ord for Align[src]
impl Ord for Align[src]impl PartialOrd<Align> for Align[src]
impl PartialOrd<Align> for Align[src]fn partial_cmp(&self, other: &Align) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Align) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for Align[src]
impl Eq for Align[src]
impl StructuralEq for Align[src]
impl StructuralPartialEq for Align[src]
Auto Trait Implementations
impl RefUnwindSafe for Align
impl Send for Align
impl Sync for Align
impl Unpin for Align
impl UnwindSafe for Align
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> MaybeResult<T> for T[src]
impl<T> MaybeResult<T> for T[src]impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more