Skip to main content

CppGraphSource

Struct CppGraphSource 

Source
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 CppWorkspaceSource

Implementations§

Source§

impl<'a> CppGraphSource<'a>

Source

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.

Source

pub fn type_alias_provider(&self) -> Option<&'a dyn TypeAliasProvider>

Source

pub fn type_hierarchy_provider(&self) -> Option<&'a dyn TypeHierarchyProvider>

Source

pub fn import_statements(&self, file: &ProjectFile) -> Vec<String>

Source

pub fn global_usage_definition_index(&self) -> CppWorkspaceDefinitions<'a>

Source

pub fn parent_of(&self, code_unit: &CodeUnit) -> Option<CodeUnit>

Source

pub fn ranges(&self, code_unit: &CodeUnit) -> Vec<Range>

Source

pub fn enclosing_code_unit( &self, file: &ProjectFile, range: &Range, ) -> Option<CodeUnit>

Source

pub fn signature_metadata(&self, code_unit: &CodeUnit) -> Vec<SignatureMetadata>

Source

pub fn cpp_field_linkage(&self, code_unit: &CodeUnit) -> Option<CppFieldLinkage>

Source

pub fn signatures(&self, code_unit: &CodeUnit) -> Vec<String>

Source

pub fn get_source( &self, code_unit: &CodeUnit, include_comments: bool, ) -> Option<String>

Source

pub fn indexed_source(&self, file: &ProjectFile) -> Option<String>

Source

pub fn declarations(&self, file: &ProjectFile) -> BTreeSet<CodeUnit>

Source

pub fn direct_children(&self, code_unit: &CodeUnit) -> Vec<CodeUnit>

Source

pub fn definitions( &self, fq_name: &str, ) -> Box<dyn Iterator<Item = CodeUnit> + '_>

Trait Implementations§

Source§

impl<'a> Clone for CppGraphSource<'a>

Source§

fn clone(&self) -> CppGraphSource<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.