Skip to main content

RefRecord

Struct RefRecord 

Source
pub struct RefRecord {
Show 22 fields pub kind: String, pub name: String, pub qualified: Option<String>, pub member: Option<String>, pub line: usize, pub namespace: Option<String>, pub type_arg_count: Option<usize>, pub generic: bool, pub receiver_type: Option<String>, pub arg_count: Option<usize>, pub receiver_args: Option<Vec<String>>, pub outer_types: Vec<String>, pub args: Option<Vec<String>>, pub receiver_property_owner: Option<String>, pub receiver_call_owner: Option<String>, pub receiver_call_member: Option<String>, pub receiver_base: bool, pub receiver_awaited: bool, pub receiver_local: bool, pub receiver_lambda: Option<LambdaSlot>, pub receiver_nullable: bool, pub lambda_arg_arity: Option<Vec<Option<usize>>>,
}
Expand description

Represents RefRecord.

Fields§

§kind: String

The kind value.

§name: String

The name value.

§qualified: Option<String>

The qualified value.

§member: Option<String>

The member value.

§line: usize

The line value.

§namespace: Option<String>

None only for ‘imports’ refs – a using directive is not namespace-scoped, so ns is deliberately null. Every other ref carries Some(ns), where ns may itself be the empty string at file scope.

§type_arg_count: Option<usize>

The type arg count value.

§generic: bool

true when a uses-member qualifier carried a type-argument list anywhere (Cache<T>.x, Ns.Cache<T>.x): syntax only a TYPE can carry, so the resolver treats it as type-certainty for non-enum member emission. Always false for every other ref kind.

§receiver_type: Option<String>

The declared type NAME of the receiver a uses-member qualifier names, when the enclosing scope holds exactly one fact for it (a declared local, a var x = new T() local, a parameter, a field, or a primary-constructor parameter). Set ONLY for a BARE, non-generic qualifier – see the member_access_expression arm’s guard, which is what makes the chain-tail hazard structurally impossible. Always None for every other ref kind.

§arg_count: Option<usize>

The argument count of the call this member access is the CALLEE of (argument_list named-child count), recorded only when the access is the function field of an invocation_expression. A property read (x.P) carries None, which is what keeps it out of the arity-matched extension tier entirely. Appended AFTER receiver_type. Always None for every other ref kind.

§receiver_args: Option<Vec<String>>

The DECLARED receiver type’s top-level type-argument descriptors, present only when that type is generic. A position naming a type parameter of the enclosing method or class is recorded as “*” (wildcard): nothing at the fact site knows its binding. Travels with receiver_type – the fact carries both or neither. Appended LAST, after arg_count.

§outer_types: Vec<String>

The walk’s own type_stack verbatim: the enclosing type simple names, OUTERMOST first, the same order type_id joins with “+” to build a nested def id. Empty at namespace level, and empty is exactly what an absent key deserializes to. Appended LAST, after receiver_args.

§args: Option<Vec<String>>

Generic-arg descriptors for a ‘ctor-param’ ref’s parameter type (same descriptor shape as receiver_args: a "*" wildcard for a pass-through of the enclosing type’s own type parameter), present only when that type is generic. None for every other ref kind. Appended LAST of all, after outer_types – ‘ctor-param’ is a ref kind no other caller touches, so putting it after that “last of all” field costs no other ref kind a single byte.

§receiver_property_owner: Option<String>

The type whose PROPERTY the qualifier’s last segment is, for a two-segment chain whose head the enclosing scope has a fact for (“a.Settings” in a.Settings.Reload()). Never travels with receiver_type: that one is bare-qualifier-only and this one is dotted-qualifier-only, which is what keeps the chain-tail hazard structurally impossible – the resolver reaches the tail’s type through the head type’s RECORDED property types, never by inheriting the head’s own. Appended after args.

§receiver_call_owner: Option<String>

The type whose METHOD a var x = Q.M(...) initializer called, and that method’s name. Always set as a pair, and never alongside receiver_type: the local’s type is whatever M returns, a lookup only the resolver can do. Appended LAST of all.

§receiver_call_member: Option<String>

The receiver call member value.

§receiver_base: bool

true for a base.M qualifier – the member lookup starts at the enclosing type’s bases and never considers the enclosing type itself. false for every other ref kind, including a plain this.M qualifier (which resolves through the ordinary typed-receiver path against the enclosing type itself). Appended LAST of all.

§receiver_awaited: bool

true when this ref’s receiver_call_owner/receiver_call_member pair came from an AWAITED call (var x = await Q.M(), _client a field: var order = await _client.FetchAsync()) – the resolver reads it to decide whether to unwrap exactly one Task<...>/ValueTask<...> layer off M’s recorded return type before typing the local. false for an unawaited call fact and for every ref carrying no call fact at all, which is what keeps var t = x.FetchAsync(); t.Wait(); typed as Task rather than unwrapped. Appended LAST of all, after receiver_base.

§receiver_local: bool

true when this ref’s qualifier is a bare identifier for which the enclosing MEMBER’s own fact table – Scope::has_local_fact, the SAME member_facts table receiver_fact_for reads first – holds ANY entry for the name: a local, a parameter, an explicitly-typed lambda parameter, a pattern designation, or an out designation, typed or taken-but-unknown. A member-scoped name always shadows a same-named field regardless of whether anything vouches for its type, so the resolver’s bare-identifier field/property fallback (Unit B) reads this to refuse running at all when it is true – the one shape a resolved receiver_type/receiver_call_owner of None cannot itself distinguish from “no fact anywhere for this name”. false for a dotted or generic qualifier, for this./ base. (never asked of the enclosing scope’s local table), and for every ref kind but uses-member. Appended LAST of all, after receiver_awaited.

§receiver_lambda: Option<LambdaSlot>

Set when this ref’s qualifier is an untyped lambda parameter whose type is a delegate parameter of some OTHER callee – a lookup only the resolver can do. Never set alongside receiver_type or receiver_call_owner: the three are mutually exclusive on one ref. receiver_local still reads true for such a ref (the parameter IS a member-scoped name), and receiver_type stays None. Appended LAST of all, after receiver_local.

§receiver_nullable: bool

true when receiver_type came off a declaration whose own type node was a nullable_type (Widget? w) – see Fact::nullable, which this carries verbatim off the SAME receiver fact receiver_type/receiver_args already came off. false for every ref kind, and for a receiver_type that came from anywhere but a plain declared-type fact (a call-hop return, a lambda-slot type, a bare field/property fallback: none of those can be nullable- annotated, since none of them read a type node directly). Appended LAST of all, after receiver_lambda.

§lambda_arg_arity: Option<Vec<Option<usize>>>

The parameter count of each delegate-shaped argument of the invocation this ref is the callee of – a lambda literal, or a bare identifier naming one unshadowed local function in scope – one entry per argument position (None at every other position), or None entirely when the ref is not invocation-shaped or names no such argument at all. x => ... counts 1 parameter, (a, b) => ... counts 2, () => ... counts 0, a local function counts its own declared parameters – the argument’s OWN arity, never the delegate type it will end up bound to (that binding is exactly what this fact lets the resolver judge, rather than assume). Appended LAST of all, after receiver_nullable.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.