Skip to main content

DefRecord

Struct DefRecord 

Source
pub struct DefRecord {
Show 25 fields pub id: String, pub name: String, pub namespace: String, pub kind: String, pub line: usize, pub methods: Vec<String>, pub properties: Vec<String>, pub fields: Vec<String>, pub method_returns: Vec<(String, String)>, pub extension_methods: Vec<ExtensionMethod>, pub bases: Vec<String>, pub type_params: Vec<String>, pub base_generic_args: Vec<(String, Vec<String>)>, pub test_methods: Vec<String>, pub property_types: Vec<(String, Fact)>, pub field_types: Vec<(String, Fact)>, pub method_return_args: Vec<(String, Vec<String>)>, pub non_public_methods: Vec<String>, pub method_arities: Vec<(String, Vec<(usize, i64)>)>, pub method_params: Vec<(String, Vec<Vec<String>>)>, pub override_methods: Vec<String>, pub base_type_args: Vec<(String, Vec<String>)>, pub property_message_args: Vec<String>, pub array_message_bases: Vec<String>, pub end_line: usize,
}
Expand description

Represents DefRecord.

Fields§

§id: String

The id value.

§name: String

The name value.

§namespace: String

The namespace value.

§kind: String

The kind value.

§line: usize

The line value.

§methods: Vec<String>

The methods value.

§properties: Vec<String>

Declared property names, source order, deduped (indexers excluded by construction: indexer_declaration is a different grammar node). NO accessibility filter, deliberately asymmetric with methods: static/const/readonly/expression-bodied all count and only indexers are excluded, so a private member is still a member of the type. Empty for every enum-member def.

§fields: Vec<String>

Declared field names, source order, deduped, every declarator of every field_declaration (“private int a, b;” contributes both). event_field_declaration is a distinct node type and is NOT a field for this purpose. Same no-accessibility-filter rule as properties.

§method_returns: Vec<(String, String)>

(method name, declared return type NAME) pairs in FIRST-declaration source order, parallel to methods (same is_recorded_method predicate, so the two can never drift). The first declaration of a name claims the slot outright: a later overload with a different return type is ignored, and a first declaration whose return type yields no fact (void, var, a predefined type) BLOCKS the name rather than letting a later overload stand in for it. A Vec of pairs, not a map: the serialized key order is significant (see graph.rs’s FragDef).

§extension_methods: Vec<ExtensionMethod>

The extension methods this type declares: every method whose FIRST parameter carries the this modifier, in source order, deduped by (name, thisType, arityMin, arityMax). Appended LAST, after method_returns, and omitted at serialization when empty. Unlike methods there is NO accessibility filter (internal static class FooExtensions is the shape this feature exists for) and no static check on either the method or its class – C# already disallows a this parameter anywhere else, so the parameter modifier IS the discriminator.

§bases: Vec<String>

The DIRECT base-type identifiers this declaration lists, in source order, deduped. Same base_list traversal record_base_list walks for its inherits refs, reduced to a base IDENTIFIER because the resolver re-RESOLVES these names through the ordinary ladder rather than matching them; the resulting closure is what lets the extension tier see an inherited instance member and decline. Appended after extension_methods and omitted when empty.

§type_params: Vec<String>

The declaring type’s OWN type-parameter names (class MongoRepository<T> records ["T"]), empty for every non-generic declaration. This is the ctor-DI resolver’s “is this def itself an open-generic implementation” signal. Appended after bases, omitted when empty.

§base_generic_args: Vec<(String, Vec<String>)>

Per base name that carried a type-argument list, that list’s generic-arg descriptors relative to type_params (a "*" wildcard marks a position that is a pass-through of the declaring type’s own parameter). A Vec of pairs, not a map, for the same reason method_returns is: the serialized key order is significant. Appended after type_params, omitted when empty; a base with no type-argument list at all contributes no entry.

§test_methods: Vec<String>

The methods this type declares that a test framework would DISCOVER as tests, in source order, deduped. Appended LAST, after base_generic_args, and omitted at serialization when empty. The attribute IS the fact, which is why this is the one member fact with no accessibility filter at all and why no file, folder or type-name convention is read anywhere.

§property_types: Vec<(String, Fact)>

(property name, declared type fact) pairs for exactly the properties properties records, in the same source order and under the same dedup. A property whose declared type yields no fact (a predefined type) has no entry, so the two lists are parallel but not equal in length. A Vec of pairs, not a map, for the same reason method_returns is one: the serialized key order is significant. Appended LAST, after test_methods.

§field_types: Vec<(String, Fact)>

(field name, declared type fact) pairs for exactly the fields fields records, in the same source order and under the same dedup. A field whose declared type yields no fact (a predefined type) has no entry, so the two lists are parallel but not equal in length. Every declarator of one field_declaration shares that declaration’s own type node, so private int a, b; gives a and b the SAME fact – the same declarator sharing fields’s own collection loop already relies on. A Vec of pairs, not a map, for the same reason property_types is one: the serialized key order is significant. Appended LAST, after property_types.

§method_return_args: Vec<(String, Vec<String>)>

Per method name that method_returns also records an entry for, that return type’s top-level generic-arg descriptors – the same capture base_generic_args keeps beside bases, for the same reason: method_returns records only the return type’s bare identifier (“Task” for Task<Order> GetAsync()), and this is what lets the resolver unwrap ONE Task<...>/ValueTask<...> layer off an AWAITED call’s callee without ever touching method_returns itself, which an unawaited use of the very same callee reads unchanged. A Vec of pairs, not a map, for the same reason method_returns is one: the serialized key order is significant. Appended LAST of all, after field_types; a method whose return type carries no type-argument list at all contributes no entry.

§non_public_methods: Vec<String>

Declared METHOD names this type does NOT record in methods, because is_recorded_method gates that list on a literal public modifier (or kind == "interface", where every method already counts as public and this list is always empty). Same predicate, same method_declaration node kind, same source order and dedup as methods – the two lists partition a type’s method declarations with no overlap and no gap. Unlike properties/fields, which already carry every accessibility with no filter at all, methods needed a counterpart list for a non-public method (protected, internal, private or no-modifier/private-by-default) to be recorded anywhere. Consulted by the resolver ONLY for hierarchy-internal receivers – a base. lookup and the this. shape’s own typed-receiver walk – never by the scored tier’s vouching or veto, which keep reading methods alone. Appended LAST of all, after method_return_args.

§method_arities: Vec<(String, Vec<(usize, i64)>)>

Method name -> the (min, max) argument-count RANGE every overload sharing that name accepts, one tuple per overload, in declaration order – covers EVERY method_declaration, public and non-public alike (unlike methods/non_public_methods, which only say a name exists, this says what a CALL of that name needs to look like). min excludes a parameter carrying a default value or the params modifier; max is the total parameter count, or -1 (unbounded) when the trailing parameter is a params array – the same sentinel ExtensionMethod::arity_max already uses. A Vec of pairs, not a map, for the same reason method_returns is one: the serialized key order is significant. Consulted by the resolver’s arity-aware call vouching: a ref carrying an argCount binds to methods/ non_public_methods only when SOME overload’s range admits it: a same-named instance member at the wrong arity does not shadow the extension tier. A read (no argCount) never consults this table. Appended LAST of all, after non_public_methods.

§method_params: Vec<(String, Vec<Vec<String>>)>

Method name -> per-overload parameter type descriptors (see type_descriptor), one Vec<String> per overload in declaration order – covers EVERY method_declaration, public and non-public alike, same method set as method_arities. A position naming the enclosing method’s or type’s own type parameter is recorded as "*" (wildcard); a parameter carrying the this modifier is written "this <descriptor>" (the extension-method marker). For a delegate def this carries exactly one entry, keyed "Invoke", built from the delegate’s own parameter list (a delegate has no body, so it is not one of the method_declaration overloads this otherwise iterates). A Vec of pairs, not a map, for the same reason method_returns is one: the serialized key order is significant. Appended LAST of all, after method_arities.

§override_methods: Vec<String>

Declared method names carrying the literal override modifier, source order, deduped. Appended LAST of all, after method_params. Consulted only by the resolver’s member-level overrides pass, itself run only for a type the resolver already knows is a registered DI implementation – see graph.rs’s FragDef.

§base_type_args: Vec<(String, Vec<String>)>

Per base name that carries a top-level type argument which is ITSELF generic, that argument list rendered by type_descriptor (nested structure intact) rather than the flattened bare identifiers base_generic_args carries – IConsumer<Batch< LoanRequested>> records [("IConsumer", ["Batch<LoanRequested>"])] here, so the inner message type survives extraction instead of collapsing to Batch. A base whose arguments are all non-generic contributes no entry: base_generic_args already carries that shape, so a second copy would add no fact. Appended LAST of all, after override_methods.

§property_message_args: Vec<String>

Every distinct single type argument the type’s own properties wrap (Event<LoanRequested> records LoanRequested), in declaration order. A long-running handler names the further messages it binds this way rather than on its base list, so the base list alone would miss them. Recorded for every type; the resolver keeps these only for a type it already holds to be a handler. Appended LAST of all, after base_type_args.

§array_message_bases: Vec<String>

Base names (a subset of bases) whose message-position argument – base_generic_args’ own position 0 – is itself an array type (IConsumer<M[]>). base_generic_args/generic_arg_descriptors both already look THROUGH an array_type to its element (the same unwrapping base_type_identifier performs generally), so this is the only place left that still knows the wrapper was there at all – the lane-owned sibling of the array bit extract::receivers::type_fact keeps for a declared local/parameter. A base whose nested argument already carries its own array suffix through base_type_args (IConsumer<Batch<M[]>>) needs no entry here: that reading is structural, off the rendered descriptor, and never loses the bracket. Appended LAST of all, after property_message_args.

§end_line: usize

1-based last line of the complete declaration node.

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.