Enum rupta::mir::path::PathSelector
source · pub enum PathSelector {
Deref,
Field(usize),
UnionField(usize),
Index,
Subslice {
from: u64,
to: u64,
from_end: bool,
},
Downcast(usize),
Discriminant,
Cast(usize),
}Expand description
The PathSelector denotes a de-referenced item, field, or element, or slice.
Variants§
Deref
Given a path that denotes a reference, select the thing the reference points to.
Field(usize)
Select the struct field with the given index.
UnionField(usize)
Selects a particular type case from a type union. all fields of a union share common storage. As a result, writes to one field of a union can overwrite its other fields, and size of a union is determined by the size of its largest field.
Index
For each field of a union, we connect it with a union offset path. Different fields at the same position connect to the same union offset path. Therefore, when writing to one field of a union, we can update the other fields at the same offset. Index into a slice/array
Subslice
These indices are generated by slice patterns.
If from_end is true slice[from..slice.len() - to].
Otherwise array[from..to].
Downcast(usize)
“Downcast” to a variant of an ADT. Currently, MIR only introduces this for ADTs with more than one variant. The value is the ordinal of the variant.
Discriminant
The tag used to indicate which case of an enum is used for a particular enum value.
Cast(usize)
Cast a path into another type. The most common cases are casting a transparent wrapper tyoe into its inner type or casting a type into a transparent wrapper type via pointer casting.
Trait Implementations§
source§impl Clone for PathSelector
impl Clone for PathSelector
source§fn clone(&self) -> PathSelector
fn clone(&self) -> PathSelector
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for PathSelector
impl Debug for PathSelector
source§impl Hash for PathSelector
impl Hash for PathSelector
source§impl PartialEq for PathSelector
impl PartialEq for PathSelector
source§fn eq(&self, other: &PathSelector) -> bool
fn eq(&self, other: &PathSelector) -> bool
self and other values to be equal, and is used
by ==.impl Copy for PathSelector
impl Eq for PathSelector
impl StructuralPartialEq for PathSelector
Auto Trait Implementations§
impl RefUnwindSafe for PathSelector
impl Send for PathSelector
impl Sync for PathSelector
impl Unpin for PathSelector
impl UnwindSafe for PathSelector
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.