Enum rustc::ty::layout::FieldPlacement
[−]
[src]
pub enum FieldPlacement {
Union(usize),
Array {
stride: Size,
count: u64,
},
Arbitrary {
offsets: Vec<Size>,
memory_index: Vec<u32>,
},
}🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Describes how the fields of a type are located in memory.
Variants
Union(usize)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
All fields start at no offset. The usize is the field count.
Array🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Array/vector-like placement, with all fields of identical types.
Fields of Array
stride: Size | 🔬 This is a nightly-only experimental API. ( |
count: u64 | 🔬 This is a nightly-only experimental API. ( |
Arbitrary🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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> | 🔬 This is a nightly-only experimental API. ( |
memory_index: Vec<u32> | 🔬 This is a nightly-only experimental API. ( |
Methods
impl FieldPlacement[src]
pub fn count(&self) -> usize[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn offset(&self, i: usize) -> Size[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn memory_index(&self, i: usize) -> usize[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn index_by_increasing_offset<'a>(
&'a self
) -> impl Iterator<Item = usize> + 'a[src]
&'a self
) -> impl Iterator<Item = usize> + 'a
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Get source indices of the fields by increasing offsets.
Trait Implementations
impl PartialEq for FieldPlacement[src]
fn eq(&self, __arg_0: &FieldPlacement) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &FieldPlacement) -> bool[src]
This method tests for !=.
impl Eq for FieldPlacement[src]
impl Hash for FieldPlacement[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)[src]
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]
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
impl Debug for FieldPlacement[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl<'gcx> HashStable<StableHashingContext<'gcx>> for FieldPlacement[src]
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'gcx>,
hasher: &mut StableHasher<W>
)[src]
&self,
hcx: &mut StableHashingContext<'gcx>,
hasher: &mut StableHasher<W>
)
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?