#[non_exhaustive]pub struct EdgeSearch<'search, Graph>where
Graph: Graph,{
pub label: Option<<Graph::Edge as Element>::Label>,
pub adjacent_label: Option<<Graph::Vertex as Element>::Label>,
pub direction: Direction,
pub limit: Option<usize>,
/* private fields */
}
Expand description
A search to apply to edges when querying a graph. This allows graph implementations to support vertex centric indexes. In the future, this will be expanded to support more complex filters than just label and direction.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.label: Option<<Graph::Edge as Element>::Label>
the label of the edges
adjacent_label: Option<<Graph::Vertex as Element>::Label>
The required adjacent label
direction: Direction
The direction of the edge to match.
limit: Option<usize>
The maximum number of edges to return for the current vertex
Implementations§
Source§impl<Graph> EdgeSearch<'_, Graph>where
Graph: Graph,
impl<Graph> EdgeSearch<'_, Graph>where
Graph: Graph,
Sourcepub fn scan() -> Self
pub fn scan() -> Self
Creates a new edge search with default settings.
This creates an edge search that will match all edges, regardless of label, adjacent label, or direction.
§Returns
A new EdgeSearch with default settings.
Sourcepub fn direction(self, direction: Direction) -> Self
pub fn direction(self, direction: Direction) -> Self
The direction of the edges relative to the starting vertex
Sourcepub fn take(self, n: usize) -> Self
pub fn take(self, n: usize) -> Self
The maximum number of edges to return relative to the starting vertex.
The name take
follows Rust’s standard library’s naming conventions.
Sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
The maximum number of edges to return relative to the starting vertex.
Sourcepub fn limit(&self) -> usize
pub fn limit(&self) -> usize
Returns the maximum number of edges to return from this search.
If no limit was set, returns usize::MAX (effectively no limit).
§Returns
The edge limit, or usize::MAX if no limit was set
Sourcepub fn adjacent_labelled(
self,
adjacent_label: <Graph::Vertex as Element>::Label,
) -> Selfwhere
Graph: Graph + SupportsEdgeAdjacentLabelIndex,
pub fn adjacent_labelled(
self,
adjacent_label: <Graph::Vertex as Element>::Label,
) -> Selfwhere
Graph: Graph + SupportsEdgeAdjacentLabelIndex,
Adjacent vertex label must match