Skip to main content

CppStructuralSpec

Struct CppStructuralSpec 

Source
pub struct CppStructuralSpec;

Trait Implementations§

Source§

impl Debug for CppStructuralSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CppStructuralSpec

Source§

fn default() -> CppStructuralSpec

Returns the “default value” for a type. Read more
Source§

impl StructuralSpec for CppStructuralSpec

Source§

fn occurrence_role_support(&self) -> &OccurrenceRoleSupport

C++ has not learned occurrence-role classification yet (#1473). The empty table is the honest answer: queries and assertions that ask for an occurrence role here report incomplete rather than clean-empty.

Source§

fn language(&self) -> Language

Source§

fn kind_table(&self) -> &'static [(&'static str, NormalizedKind)]

Grammar-specific node-type name → normalized kind. Compiled once per extraction into an id-indexed lookup via Language::id_for_node_kind; a per-language test must assert every entry resolves (id != 0) so grammar bumps that rename nodes fail loudly.
Source§

fn refine_kind( &self, node: Node<'_>, kind: NormalizedKind, enclosing: Option<NormalizedKind>, source: &str, ) -> NormalizedKind

Context-sensitive refinement applied after table lookup. enclosing is the kind of the nearest enclosing normalized node.
Source§

fn supports_kind(&self, kind: NormalizedKind) -> bool

Whether this adapter can produce facts satisfying kind.
Source§

fn supports_role(&self, role: Role) -> bool

Whether this adapter can model role precisely enough to evaluate a query that asks for it.
Source§

fn lexical_environment_support(&self) -> &LexicalEnvironmentSupport

Which parts of a file’s lexical environment this adapter answers: its scope tree, the interval each binding is in effect over, the local names its imports introduce, its package clause, and what its resolver reports about the candidates it considered. Read more
Source§

fn materialization_support(&self) -> &DeclarationMaterializationSupport

Which parts of a file’s declaration-materialization story this adapter answers: the origin and state of its declarations, its generation sites and their generated sets, its export declarations, the link from a declaration-only signature to its implementation, and which declarations are gated by a preprocessing configuration. Read more
Source§

fn reference_edge_support(&self) -> &ReferenceEdgeSupport

Which parts of the reference-edge domain this adapter answers: whether forward (site-to-target) and inverse (target-to-site) edge projections exist for it, and which classification axes those edges carry. Read more
Source§

fn identity_route_support(&self) -> &IdentityRouteSupport

Which parts of the identity/route surface this adapter answers: whether it can group and decode qualified paths, resolve segment prefixes, project canonical identities, group physical occurrences, and which indirection relations it supplies route edges for. Self::occurrence_role_support: the tables are total, so a default would let a new adapter (or a new axis or relation) advertise support nobody implemented. Adapters that answer nothing yet return super::routes::NO_IDENTITY_ROUTE_SUPPORT.
Source§

fn extract(&self, node: Node<'_>, kind: NormalizedKind, sink: &mut RoleSink<'_>)

Attach the fact’s name and role edges by reading AST fields of node.
Source§

fn should_extract(&self, _node: Node<'_>, _kind: NormalizedKind) -> bool

Whether this normalized node should become a fact at all. Use this for grammar nodes whose normalized kind is conditional on fields, such as variable declarators that are assignments only when they have values.
Source§

fn generator_construct( &self, _node: Node<'_>, _kind: NormalizedKind, ) -> Option<&'static str>

A grammar-backed construct label for semantic generator rules. Read more
Source§

fn binding_activation( &self, _binder: Node<'_>, _scope: Range, ) -> Option<BindingActivation>

What binding binder introduces into the scope whose range is scope, and over which byte interval it is in effect. Read more
Source§

fn occurrence_namespace( &self, role: OccurrenceRole, declares: Option<NormalizedKind>, ) -> Option<Namespace>

The namespace an occurrence of role resolves in, where declares is the normalized kind of the fact this token names – the enclosing fact whose own name span is exactly this token, and None when the token names no fact. Read more
Source§

fn indirection_relation(&self, _token: Node<'_>) -> Option<RouteHopKind>

The indirection relation an import/export token participates in: Import for a plain import, Export for an export of a local declaration, ReExport for an export whose subject comes from elsewhere (pub use, export ... from). Read from the token’s enclosing statement through AST fields. Read more
Source§

fn qualified_path_root<'tree>(&self, _token: Node<'tree>) -> Option<Node<'tree>>

The root node of the qualified-path chain token participates in: the outermost chain node (a scoped_identifier, dotted_name, nested_identifier, or language equivalent) whose ordered segments include this token. None when the token is not part of a qualified path — including when it is a bare single identifier, which is not a path. Read more
Source§

fn path_segment_tokens<'tree>(&self, _root: Node<'tree>) -> Vec<Node<'tree>>

Every segment token of the qualified-path chain rooted at root, in source order, read from the grammar’s own chain structure (AST fields, never text splitting). Includes segment tokens that are not facts (Rust’s crate/self/super path keywords), so ordinals state the real position of each segment within the path. Read more
Source§

fn segment_generic_arity(&self, _token: Node<'_>) -> Option<u32>

The number of generic (type) arguments the source spells at token’s segment position, read from the grammar’s argument-list field. None means no generic arguments are spelled there — which is a statement about the source text, not about the declaration’s own arity.
Source§

fn decode_spelling(&self, _raw: &str) -> Option<String>

The spelling raw denotes once the grammar’s identifier escaping is removed (Rust’s r#type is the identifier type). Read more
Source§

fn embedded_leaf_facts( &self, _node: Node<'_>, _kind: NormalizedKind, _source: &str, _cancellation: Option<&CancellationToken>, ) -> Vec<EmbeddedLeafFact>

Parse source-backed leaf facts hidden inside an otherwise opaque node. Read more

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> CapabilityProvider for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = Infallible

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.