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,
}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 CppWorkspaceSourceImplementations§
Source§impl<'a> CppGraphSource<'a>
impl<'a> CppGraphSource<'a>
Sourcepub fn from_source(source: &'a dyn CppSource) -> Self
pub fn from_source(source: &'a dyn CppSource) -> 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 global_usage_definition_index(&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>
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