Struct rustc_target::abi::Size [−][src]
pub struct Size {
raw: u64,
}Expand description
Size of a type in bytes.
Fields
raw: u64Implementations
impl Size[src]
impl Size[src]pub const ZERO: Size[src]
pub fn from_bits(bits: impl TryInto<u64>) -> Size[src]
pub fn from_bits(bits: impl TryInto<u64>) -> Size[src]Rounds bits up to the next-higher byte boundary, if bits is
is not aligned.
pub fn from_bytes(bytes: impl TryInto<u64>) -> Size[src]
pub fn bytes(self) -> u64[src]
pub fn bytes_usize(self) -> usize[src]
pub fn bits(self) -> u64[src]
pub fn bits_usize(self) -> usize[src]
pub fn align_to(self, align: Align) -> Size[src]
pub fn is_aligned(self, align: Align) -> bool[src]
pub fn checked_add<C: HasDataLayout>(self, offset: Size, cx: &C) -> Option<Size>[src]
pub fn checked_mul<C: HasDataLayout>(self, count: u64, cx: &C) -> Option<Size>[src]
pub fn sign_extend(self, value: u128) -> u128[src]
pub fn sign_extend(self, value: u128) -> u128[src]Truncates value to self bits and then sign-extends it to 128 bits
(i.e., if it is negative, fill with 1’s on the left).
Trait Implementations
impl AddAssign<Size> for Size[src]
impl AddAssign<Size> for Size[src]fn add_assign(&mut self, other: Size)[src]
fn add_assign(&mut self, other: Size)[src]Performs the += operation. Read more
impl<__CTX> HashStable<__CTX> for Size where
__CTX: HashStableContext, [src]
impl<__CTX> HashStable<__CTX> for Size where
__CTX: HashStableContext, [src]fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)[src]
impl Ord for Size[src]
impl Ord for Size[src]impl PartialOrd<Size> for Size[src]
impl PartialOrd<Size> for Size[src]fn partial_cmp(&self, other: &Size) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Size) -> 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 Size[src]
impl Eq for Size[src]
impl StructuralEq for Size[src]
impl StructuralPartialEq for Size[src]
Auto Trait Implementations
impl RefUnwindSafe for Size
impl Send for Size
impl Sync for Size
impl Unpin for Size
impl UnwindSafe for Size
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