Struct rustc::ty::layout::Struct
[−]
[src]
pub struct Struct { pub align: Align, pub packed: bool, pub sized: bool, pub offsets: Vec<Size>, pub memory_index: Vec<u32>, pub min_size: Size, }
rustc_private
)A structure, a product type in ADT terms.
Fields
align: Align
rustc_private
)packed: bool
rustc_private
)If true, no alignment padding is used.
sized: bool
rustc_private
)If true, the size is exact, otherwise it's only a lower bound.
offsets: Vec<Size>
rustc_private
)Offsets for the first byte of each field, ordered to match the source definition order. This vector does not go in increasing order. FIXME(eddyb) use small vector optimization for the common case.
memory_index: Vec<u32>
rustc_private
)Maps source order field indices to memory order indices, depending how fields were permuted. FIXME (camlorn) also consider small vector optimization here.
min_size: Size
rustc_private
)Methods
impl<'a, 'gcx, 'tcx> Struct
[src]
fn stride(&self) -> Size
rustc_private
)Get the size with trailing alignment padding.
fn would_be_zero_sized<I>(dl: &TargetDataLayout,
fields: I)
-> Result<bool, LayoutError<'gcx>> where I: Iterator<Item=Result<&'a Layout, LayoutError<'gcx>>>
fields: I)
-> Result<bool, LayoutError<'gcx>> where I: Iterator<Item=Result<&'a Layout, LayoutError<'gcx>>>
rustc_private
)Determine whether a structure would be zero-sized, given its fields.
fn field_index_by_increasing_offset<'b>(&'b self)
-> impl Iterator<Item=usize> + 'b
-> impl Iterator<Item=usize> + 'b
rustc_private
)Get indices of the tys that made this struct by increasing offset.
Trait Implementations
impl PartialEq for Struct
[src]
fn eq(&self, __arg_0: &Struct) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Struct) -> bool
This method tests for !=
.
impl Eq for Struct
[src]
impl Hash for Struct
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.