[][src]Struct rustc_ap_rustc_target::abi::TyLayout

pub struct TyLayout<'a, Ty> {
    pub ty: Ty,
    pub details: &'a LayoutDetails,
}

The details of the layout of a type, alongside the type itself. Provides various type traversal APIs (e.g., recursing into fields).

Note that the details are NOT guaranteed to always be identical to those obtained from layout_of(ty), as we need to produce layouts for which Rust types do not exist, such as enum variants or synthetic fields of enums (i.e., discriminants) and fat pointers.

Fields

ty: Tydetails: &'a LayoutDetails

Methods

impl<'a, Ty> TyLayout<'a, Ty>[src]

pub fn homogeneous_aggregate<C>(&self, cx: &C) -> HomogeneousAggregate where
    Ty: TyLayoutMethods<'a, C> + Copy,
    C: LayoutOf<Ty = Ty, TyLayout = Self>, 
[src]

Returns true if this layout is an aggregate containing fields of only a single type (e.g., (u32, u32)). Such aggregates are often special-cased in ABIs.

Note: We generally ignore fields of zero-sized type when computing this value (see #56877).

This is public so that it can be used in unit tests, but should generally only be relevant to the ABI details of specific targets.

impl<'a, Ty> TyLayout<'a, Ty>[src]

pub fn for_variant<C>(self, cx: &C, variant_index: VariantIdx) -> Self where
    Ty: TyLayoutMethods<'a, C>,
    C: LayoutOf<Ty = Ty>, 
[src]

pub fn field<C>(self, cx: &C, i: usize) -> C::TyLayout where
    Ty: TyLayoutMethods<'a, C>,
    C: LayoutOf<Ty = Ty>, 
[src]

pub fn pointee_info_at<C>(self, cx: &C, offset: Size) -> Option<PointeeInfo> where
    Ty: TyLayoutMethods<'a, C>,
    C: LayoutOf<Ty = Ty>, 
[src]

impl<'a, Ty> TyLayout<'a, Ty>[src]

pub fn is_unsized(&self) -> bool[src]

Returns true if the layout corresponds to an unsized type.

pub fn is_zst(&self) -> bool[src]

Returns true if the type is a ZST and not unsized.

Methods from Deref<Target = &'a LayoutDetails>

Trait Implementations

impl<'a, Ty: Clone> Clone for TyLayout<'a, Ty>[src]

impl<'a, Ty: Copy> Copy for TyLayout<'a, Ty>[src]

impl<'a, Ty: Eq> Eq for TyLayout<'a, Ty>[src]

impl<'a, Ty: PartialEq> PartialEq<TyLayout<'a, Ty>> for TyLayout<'a, Ty>[src]

impl<'a, Ty: Debug> Debug for TyLayout<'a, Ty>[src]

impl<'a, Ty> Deref for TyLayout<'a, Ty>[src]

type Target = &'a LayoutDetails

The resulting type after dereferencing.

impl<'a, Ty: Hash> Hash for TyLayout<'a, Ty>[src]

Auto Trait Implementations

impl<'a, Ty> Send for TyLayout<'a, Ty> where
    Ty: Send

impl<'a, Ty> Sync for TyLayout<'a, Ty> where
    Ty: Sync

impl<'a, Ty> Unpin for TyLayout<'a, Ty> where
    Ty: Unpin

impl<'a, Ty> UnwindSafe for TyLayout<'a, Ty> where
    Ty: UnwindSafe

impl<'a, Ty> RefUnwindSafe for TyLayout<'a, Ty> where
    Ty: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<E> SpecializationError for E[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T[src]