pub struct GraphQuery {
pub start_nodes: Vec<String>,
pub direction: TraversalDirection,
pub max_depth: usize,
pub edge_types: Option<Vec<EdgeType>>,
pub max_results: usize,
pub language_filter: Option<String>,
pub granularity_filter: Option<String>,
pub include_start: bool,
}Expand description
A query against the graph
Fields§
§start_nodes: Vec<String>Starting chunk IDs
direction: TraversalDirectionDirection of traversal
max_depth: usizeMaximum depth to traverse
edge_types: Option<Vec<EdgeType>>Edge types to follow
max_results: usizeMaximum nodes to return
language_filter: Option<String>Filter by language
granularity_filter: Option<String>Filter by granularity
include_start: boolInclude the starting nodes in results
Implementations§
Source§impl GraphQuery
impl GraphQuery
Sourcepub fn dependencies(chunk_id: impl Into<String>) -> Self
pub fn dependencies(chunk_id: impl Into<String>) -> Self
Query dependencies (things this chunk needs)
Sourcepub fn dependents(chunk_id: impl Into<String>) -> Self
pub fn dependents(chunk_id: impl Into<String>) -> Self
Query dependents (things that need this chunk)
Sourcepub fn with_direction(self, direction: TraversalDirection) -> Self
pub fn with_direction(self, direction: TraversalDirection) -> Self
Set traversal direction
Sourcepub fn with_depth(self, depth: usize) -> Self
pub fn with_depth(self, depth: usize) -> Self
Set maximum depth
Sourcepub fn with_edge_types(self, types: Vec<EdgeType>) -> Self
pub fn with_edge_types(self, types: Vec<EdgeType>) -> Self
Filter by edge types
Sourcepub fn strong_only(self) -> Self
pub fn strong_only(self) -> Self
Only follow strong dependencies
Sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
Set maximum results
Sourcepub fn with_language(self, language: impl Into<String>) -> Self
pub fn with_language(self, language: impl Into<String>) -> Self
Filter by language
Sourcepub fn include_start(self, include: bool) -> Self
pub fn include_start(self, include: bool) -> Self
Whether to include start nodes
Sourcepub fn should_follow_edge(&self, edge_type: EdgeType) -> bool
pub fn should_follow_edge(&self, edge_type: EdgeType) -> bool
Check if an edge type should be followed
Trait Implementations§
Source§impl Clone for GraphQuery
impl Clone for GraphQuery
Source§fn clone(&self) -> GraphQuery
fn clone(&self) -> GraphQuery
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GraphQuery
impl Debug for GraphQuery
Source§impl Default for GraphQuery
impl Default for GraphQuery
Source§fn default() -> GraphQuery
fn default() -> GraphQuery
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GraphQuery
impl<'de> Deserialize<'de> for GraphQuery
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GraphQuery
impl RefUnwindSafe for GraphQuery
impl Send for GraphQuery
impl Sync for GraphQuery
impl Unpin for GraphQuery
impl UnwindSafe for GraphQuery
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
Mutably borrows from an owned value. Read more