pub struct CppGraphSource<'a> {
pub index: &'a dyn CodeUnitIndex,
pub cpp: Option<&'a dyn CppSource>,
pub aliases: Option<&'a dyn TypeAliasProvider>,
pub hierarchy: Option<&'a dyn TypeHierarchyProvider>,
pub workspace: &'a dyn CppWorkspaceSource,
pub token: QueryToken<'a>,
}Expand description
The dispatching analyzer’s side of a C++ usage-graph scan.
Deliberately not the C++ analyzer, for the reason recorded on
PythonGraphSource and CSharpGraphSource: in a mixed workspace the query
is issued against a MultiAnalyzer, whose definitions merges every
language’s shards and whose provider accessors cross language boundaries.
The C++ analyzer that answers the C++-only questions rides along in
Self::cpp, resolved once by the shim’s resolve_analyzer::<CppAnalyzer>
downcast instead of once per call site as before the move; None is the
same answer that downcast’s else arm gave.
Fields§
§index: &'a dyn CodeUnitIndex§cpp: Option<&'a dyn CppSource>§aliases: Option<&'a dyn TypeAliasProvider>§hierarchy: Option<&'a dyn TypeHierarchyProvider>§workspace: &'a dyn CppWorkspaceSource§token: QueryToken<'a>Proof that the request scope this bundle serves is open. The bundle is a per-query object built at a query boundary, so the syntax accessors its resolution paths reach can take the proof from here rather than from ninety extra parameters (issue #2414 step 3).
Implementations§
Source§impl<'a> CppGraphSource<'a>
impl<'a> CppGraphSource<'a>
Sourcepub fn from_source(source: &'a dyn CppSource, token: QueryToken<'a>) -> Self
pub fn from_source(source: &'a dyn CppSource, token: QueryToken<'a>) -> Self
The C++ source standing in for the dispatching analyzer.
For the four resolution paths that only ever had the concrete C++
analyzer in hand: they passed &CppAnalyzer where a &dyn IAnalyzer
was wanted, and its type_alias_provider()/type_hierarchy_provider()
both answered Some(self), so every field is the same object here too.
pub fn type_alias_provider(&self) -> Option<&'a dyn TypeAliasProvider>
pub fn type_hierarchy_provider(&self) -> Option<&'a dyn TypeHierarchyProvider>
pub fn import_statements(&self, file: &ProjectFile) -> Vec<String>
pub fn workspace_definitions(&self) -> CppWorkspaceDefinitions<'a>
pub fn parent_of(&self, code_unit: &CodeUnit) -> Option<CodeUnit>
pub fn ranges(&self, code_unit: &CodeUnit) -> Vec<Range>
pub fn enclosing_code_unit( &self, file: &ProjectFile, range: &Range, ) -> Option<CodeUnit>
pub fn signature_metadata(&self, code_unit: &CodeUnit) -> Vec<SignatureMetadata>
pub fn cpp_field_linkage(&self, code_unit: &CodeUnit) -> Option<CppFieldLinkage>
pub fn signatures(&self, code_unit: &CodeUnit) -> Vec<String>
pub fn get_source( &self, code_unit: &CodeUnit, include_comments: bool, ) -> Option<String>
pub fn indexed_source(&self, file: &ProjectFile) -> Option<String>
pub fn declarations(&self, file: &ProjectFile) -> BTreeSet<CodeUnit>
Sourcepub fn reference_uses_c_semantics(&self, file: &ProjectFile) -> bool
pub fn reference_uses_c_semantics(&self, file: &ProjectFile) -> bool
Whether a reference written in file reads C++ source with C semantics
(issue #1970). Without a C++ analyzer behind this source only the path
evidence is available, which is exactly what
resolver::is_c_source_file answered before headers gained a second
reading.
Sourcepub fn declarations_in_reading(
&self,
file: &ProjectFile,
c_semantics: bool,
) -> BTreeSet<CodeUnit>
pub fn declarations_in_reading( &self, file: &ProjectFile, c_semantics: bool, ) -> BTreeSet<CodeUnit>
crate::graph_support::CppSource::declarations_in_reading, falling
back to the single reading a bare index can serve.
Sourcepub fn site_equivalent_units(&self, code_unit: &CodeUnit) -> Vec<CodeUnit>
pub fn site_equivalent_units(&self, code_unit: &CodeUnit) -> Vec<CodeUnit>
crate::graph_support::CppSource::site_equivalent_units, empty
without a C++ analyzer.
pub fn direct_children(&self, code_unit: &CodeUnit) -> Vec<CodeUnit>
pub fn definitions( &self, fq_name: &str, ) -> Box<dyn Iterator<Item = CodeUnit> + '_>
Trait Implementations§
Source§impl<'a> Clone for CppGraphSource<'a>
impl<'a> Clone for CppGraphSource<'a>
Source§fn clone(&self) -> CppGraphSource<'a>
fn clone(&self) -> CppGraphSource<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for CppGraphSource<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for CppGraphSource<'a>
impl<'a> !Send for CppGraphSource<'a>
impl<'a> !Sync for CppGraphSource<'a>
impl<'a> !UnwindSafe for CppGraphSource<'a>
impl<'a> Freeze for CppGraphSource<'a>
impl<'a> Unpin for CppGraphSource<'a>
impl<'a> UnsafeUnpin for CppGraphSource<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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