pub enum MemberRef {
Absolute(u16),
Deferred {
field_name: Symbol,
field_type: TypeId,
},
DeferredByIndex {
parent_type: TypeId,
relative_index: u16,
},
}Expand description
Symbolic reference to a struct field or enum variant. Resolved to absolute member index during bytecode emission.
Struct field indices are deduplicated globally: same (name, type) pair → same index. This enables call-site scoping where uncaptured refs share the caller’s scope.
Enum variant indices use the traditional (parent_type, relative_index) approach since enum variants don’t bubble between scopes.
Variants§
Absolute(u16)
Already resolved to absolute index (for cases where it’s known).
Deferred
Deferred resolution by field identity (for struct fields). The same (field_name, field_type) pair resolves to the same member index regardless of which struct type contains it.
Fields
DeferredByIndex
Deferred resolution by parent type + relative index (for enum variants). Uses the parent enum’s member_base + relative_index.
Implementations§
Source§impl MemberRef
impl MemberRef
Sourcepub fn deferred(field_name: Symbol, field_type: TypeId) -> Self
pub fn deferred(field_name: Symbol, field_type: TypeId) -> Self
Create a deferred reference by field identity (for struct fields).
Sourcepub fn deferred_by_index(parent_type: TypeId, relative_index: u16) -> Self
pub fn deferred_by_index(parent_type: TypeId, relative_index: u16) -> Self
Create a deferred reference by parent type + index (for enum variants).
Trait Implementations§
impl Copy for MemberRef
impl Eq for MemberRef
impl StructuralPartialEq for MemberRef
Auto Trait Implementations§
impl Freeze for MemberRef
impl RefUnwindSafe for MemberRef
impl Send for MemberRef
impl Sync for MemberRef
impl Unpin for MemberRef
impl UnwindSafe for MemberRef
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.