pub struct FragDef {Show 21 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: OrderedMap<String>,
pub extension_methods: Vec<FragExtensionMethod>,
pub bases: Vec<String>,
pub type_params: Vec<String>,
pub base_generic_args: OrderedMap<Vec<String>>,
pub test_methods: Vec<String>,
pub property_types: OrderedMap<FragFact>,
pub field_types: OrderedMap<FragFact>,
pub method_return_args: OrderedMap<Vec<String>>,
pub non_public_methods: Vec<String>,
pub method_arities: OrderedMap<Vec<(usize, i64)>>,
pub method_params: OrderedMap<Vec<Vec<String>>>,
pub end_line: usize,
}Expand description
Field order is significant: id, name, namespace, kind, line, methods, then the member-fact additions in that exact order – properties, fields, methodReturns – and after those extensionMethods, appended LAST. Each is omitted entirely when empty, so a type declaring none of them serializes exactly as it did before those additions.
Fields§
§id: StringThe id value.
name: StringThe name value.
namespace: StringThe namespace value.
kind: StringThe kind value.
line: usizeThe line value.
methods: Vec<String>The methods value.
properties: Vec<String>The properties value.
fields: Vec<String>The fields value.
method_returns: OrderedMap<String>Member name -> declared return type NAME, in FIRST-DECLARATION SOURCE
ORDER – deliberately OrderedMap, never a BTreeMap: this is an
ordered pair list, and sorting the keys here would break the
serialized bytes.
extension_methods: Vec<FragExtensionMethod>The extension methods this type declares, in source
order, deduped by (name, thisType, arityMin, arityMax). Appended after
method_returns, and omitted entirely when empty, so a type declaring
none keeps its exact prior bytes.
bases: Vec<String>DIRECT base-type identifiers, source
order, deduped. Appended LAST, after extension_methods, omitted when
empty. A resolution input only: resolve_graph strips it (along with
properties/fields/extensionMethods) before graph.json’s def rows, so
the on-disk def bytes are unchanged.
type_params: Vec<String>The declaring type’s own type-parameter names, empty for
every non-generic declaration. Appended after bases, omitted when
empty. A resolution input, like bases: the ctor-DI resolver’s
“is this def itself an open-generic implementation” signal.
base_generic_args: OrderedMap<Vec<String>>Per base name that carried a type-argument list, that
list’s generic-arg descriptors relative to type_params (OrderedMap
for the same reason method_returns is one: the serialized key order
is significant). Appended after type_params, omitted when
empty.
test_methods: Vec<String>The methods a test framework would DISCOVER as
tests, source order, deduped. Appended LAST, after baseGenericArgs,
omitted when empty. Unlike its neighbours this one is NOT stripped by
resolve_graph: it is what devscout tests answers from.
property_types: OrderedMap<FragFact>Property name -> declared type fact, in source order and
under the same dedup as properties. An OrderedMap for the same
reason method_returns is one: the serialized key order is significant.
Appended LAST, after test_methods, omitted when empty. A
resolution input only, like properties/fields.
field_types: OrderedMap<FragFact>Field name -> declared type fact, in source order and
under the same dedup as fields. Mirrors propertyTypes field for
field: an OrderedMap for the same reason (the serialized key order
is significant), a resolution input only, like properties/fields,
and this is a purely additive field – an absent key reads back as
“no fields typed”, the safe default for every fragment cached before
this field existed, so it joins the schema with no cache-version
bump. Appended right after propertyTypes, omitted when empty.
method_return_args: OrderedMap<Vec<String>>Per method name methodReturns also carries an entry for,
that return type’s top-level generic-arg descriptors – the same
capture baseGenericArgs keeps beside bases (see extract.rs’s
DefRecord). methodReturns itself is left exactly as it always
was (the bare return-type identifier, “Task” for
Task<Order> GetAsync()) so an UNAWAITED use of the same callee
keeps reading “Task” unchanged; this is a purely additive sibling
field, not a reshaping of methodReturns, which is what lets it
join the schema with no cache-version bump – an absent key reads
back as “no generic args”, the safe default for every fragment
cached before this field existed. Appended LAST of all, after
fieldTypes, omitted when empty.
non_public_methods: Vec<String>Declared method names methods does not carry because
is_recorded_method gates that list on a literal public modifier
(or kind == "interface", where this list is always empty). Source
order, no dedup, same as methods. A resolution input only, like
properties/fields/bases: resolve_graph strips it before
graph.json’s def rows. Consulted only for hierarchy-internal
receivers (base. and the this. shape’s own base walk); the
scored tier keeps reading methods alone. Appended LAST of all,
after methodReturnArgs, omitted when empty – purely additive, so
an absent key reads back as “no non-public methods”, the safe
default for every fragment cached before this field existed, which
is what lets it join the schema with no cache-version bump.
method_arities: OrderedMap<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, public and non-public alike (see
extract::DefRecord::method_arities). max is -1 for an unbounded
params overload, the same sentinel FragExtensionMethod::arity_max
already uses. An OrderedMap for the same reason methodReturns is
one: the serialized key order is significant. Appended LAST of all,
after nonPublicMethods, omitted when empty – purely additive, so
an absent key reads back as “no arity facts”, the safe default for
every fragment cached before this field existed, which is what lets
it join the schema with no cache-version bump.
method_params: OrderedMap<Vec<Vec<String>>>Method name -> per-overload parameter type descriptors, one
Vec<String> per overload in declaration order – covers every
method, public and non-public alike, same method set as
methodArities (see extract::DefRecord::method_params). A
position naming a type parameter of the enclosing method or class is
recorded as "*"; a parameter carrying the this modifier is
written "this <descriptor>". A delegate def carries exactly one
entry here, keyed "Invoke". An OrderedMap for the same reason
methodArities is one: the serialized key order is significant.
Appended LAST of all, after methodArities, omitted when empty.
Joined the schema with the v18 cache bump: a v17 fragment read back
carries none, and every overload-shape/this-marker/callee-slot
lookup this field backs would silently see no candidates.
end_line: usizeThe end line value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FragDef
impl<'de> Deserialize<'de> for FragDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for FragDef
Auto Trait Implementations§
impl Freeze for FragDef
impl RefUnwindSafe for FragDef
impl Send for FragDef
impl Sync for FragDef
impl Unpin for FragDef
impl UnsafeUnpin for FragDef
impl UnwindSafe for FragDef
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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