Enum rustc_target::abi::FieldPlacement [−][src]
pub enum FieldPlacement { Union(usize), Array { stride: Size, count: u64, }, Arbitrary { offsets: Vec<Size>, memory_index: Vec<u32>, }, }
Describes how the fields of a type are located in memory.
Variants
Union(usize)
All fields start at no offset. The usize
is the field count.
Array
Array/vector-like placement, with all fields of identical types.
Fields of Array
stride: Size | |
count: u64 |
Arbitrary
Struct-like placement, with precomputed offsets.
Fields are guaranteed to not overlap, but note that gaps before, between and after all the fields are NOT always padding, and as such their contents may not be discarded. For example, enum variants leave a gap at the start, where the discriminant field in the enum layout goes.
Fields of Arbitrary
offsets: Vec<Size> | Offsets for the first byte of each field, ordered to match the source definition order. This vector does not go in increasing order. |
memory_index: Vec<u32> | Maps source order field indices to memory order indices, depending how fields were permuted. |
Methods
impl FieldPlacement
[src]
impl FieldPlacement
pub fn count(&self) -> usize
[src]
pub fn count(&self) -> usize
pub fn offset(&self, i: usize) -> Size
[src]
pub fn offset(&self, i: usize) -> Size
pub fn memory_index(&self, i: usize) -> usize
[src]
pub fn memory_index(&self, i: usize) -> usize
pub fn index_by_increasing_offset<'a>(
&'a self
) -> impl Iterator<Item = usize> + 'a
[src]
pub fn index_by_increasing_offset<'a>(
&'a self
) -> impl Iterator<Item = usize> + 'a
Get source indices of the fields by increasing offsets.
Trait Implementations
impl PartialEq for FieldPlacement
[src]
impl PartialEq for FieldPlacement
fn eq(&self, other: &FieldPlacement) -> bool
[src]
fn eq(&self, other: &FieldPlacement) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &FieldPlacement) -> bool
[src]
fn ne(&self, other: &FieldPlacement) -> bool
This method tests for !=
.
impl Eq for FieldPlacement
[src]
impl Eq for FieldPlacement
impl Hash for FieldPlacement
[src]
impl Hash for FieldPlacement
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for FieldPlacement
[src]
impl Debug for FieldPlacement
Auto Trait Implementations
impl Send for FieldPlacement
impl Send for FieldPlacement
impl Sync for FieldPlacement
impl Sync for FieldPlacement