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.
In the case of primitives the number of fields is 0
.
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]
impl FieldPlacement
pub fn count(&self) -> usize
[src]
pub fn count(&self) -> 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?
pub fn offset(&self, i: usize) -> Size
[src]
pub fn offset(&self, i: usize) -> Size
🔬 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]
pub fn memory_index(&self, i: usize) -> 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?
pub fn index_by_increasing_offset(
&'a self
) -> impl Iterator<Item = usize> + 'a
[src]
pub fn index_by_increasing_offset(
&'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 Debug for FieldPlacement
[src]
impl Debug for FieldPlacement
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Eq for FieldPlacement
[src]
impl Eq for FieldPlacement
fn assert_receiver_is_total_eq(&self)
[src]
fn assert_receiver_is_total_eq(&self)
impl Hash for FieldPlacement
[src]
impl Hash for FieldPlacement
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
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 PartialEq<FieldPlacement> for FieldPlacement
[src]
impl PartialEq<FieldPlacement> 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<'a> HashStable<StableHashingContext<'a>> for FieldPlacement
[src]
impl<'a> HashStable<StableHashingContext<'a>> for FieldPlacement
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>
)
[src]
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'a>,
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?
Auto Trait Implementations
impl Send for FieldPlacement
impl Send for FieldPlacement
impl Sync for FieldPlacement
impl Sync for FieldPlacement