Skip to main content

DefRecord

Struct DefRecord 

Source
pub struct DefRecord {
Show 16 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 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.

§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, <T as TryFrom<U>>::Error>

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.