Skip to main content

GraphSource

Trait GraphSource 

Source
pub trait GraphSource {
    // Required methods
    fn store(&self) -> &Connection;
    fn checks_sources(&self) -> bool;
    fn file_served(&self, path: &str) -> bool;
    fn symbol_served(&self, path: &str, name: &str) -> bool;
    fn rankable_files(
        &self,
        files: Vec<String>,
        edges: &[(String, String)],
        seeds: &[String],
    ) -> HashSet<String>;
}
Expand description

A graph store as a whole-graph computation reads it — a ranking, a community detection, a rule scan: the rows, and the serve-time source check that decides which of them exist for the computation (G04).

CodeGraph answers with the gate of the request that opened it. A bare Connection has no project root on record and admits everything; it is the form of a graph that is not served from a project (in memory).

Required Methods§

Source

fn store(&self) -> &Connection

The connection the rows are read from.

Source

fn checks_sources(&self) -> bool

Whether this source asks current sources at all. false for a store without a project root: a caller that would name several files in one row must then leave that row to a check that can decide them.

Source

fn file_served(&self, path: &str) -> bool

Whether the file path may be used now.

Source

fn symbol_served(&self, path: &str, name: &str) -> bool

Whether the symbol name of path may be used now.

Source

fn rankable_files( &self, files: Vec<String>, edges: &[(String, String)], seeds: &[String], ) -> HashSet<String>

The files of files that may enter a computation over the whole graph (GraphGate::ranking_files).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl GraphSource for Connection

Source§

fn store(&self) -> &Connection

Source§

fn checks_sources(&self) -> bool

Source§

fn file_served(&self, _path: &str) -> bool

Source§

fn symbol_served(&self, _path: &str, _name: &str) -> bool

Source§

fn rankable_files( &self, files: Vec<String>, _edges: &[(String, String)], _seeds: &[String], ) -> HashSet<String>

Source§

impl<T: GraphSource + ?Sized> GraphSource for &T

A reference to a source is that source (&graph where graph is already a &CodeGraph).

Source§

fn store(&self) -> &Connection

Source§

fn checks_sources(&self) -> bool

Source§

fn file_served(&self, path: &str) -> bool

Source§

fn symbol_served(&self, path: &str, name: &str) -> bool

Source§

fn rankable_files( &self, files: Vec<String>, edges: &[(String, String)], seeds: &[String], ) -> HashSet<String>

Implementors§