Skip to main content

graphrecords_query/traits/
traversal.rs

1use crate::operations::EdgeDirection;
2
3pub trait Edges {
4    type ReturnOperand;
5
6    fn edges(&self, direction: EdgeDirection) -> Self::ReturnOperand;
7}
8
9pub trait Neighbors {
10    type ReturnOperand;
11
12    fn neighbors(&self, direction: EdgeDirection) -> Self::ReturnOperand;
13}
14
15pub trait Nodes {
16    type ReturnOperand;
17
18    fn nodes(&self) -> Self::ReturnOperand;
19}
20
21pub trait SourceNode {
22    type ReturnOperand;
23
24    fn source_node(&self) -> Self::ReturnOperand;
25}
26
27pub trait TargetNode {
28    type ReturnOperand;
29
30    fn target_node(&self) -> Self::ReturnOperand;
31}
32
33pub trait ViaEdges {
34    type ReturnOperand;
35
36    fn via_edges(&self, direction: EdgeDirection) -> Self::ReturnOperand;
37}
38
39pub trait ViaNeighbors {
40    type ReturnOperand;
41
42    fn via_neighbors(&self, direction: EdgeDirection) -> Self::ReturnOperand;
43}
44
45pub trait ViaNodes {
46    type ReturnOperand;
47
48    fn via_nodes(&self) -> Self::ReturnOperand;
49}
50
51pub trait ViaSourceNode {
52    type ReturnOperand;
53
54    fn via_source_node(&self) -> Self::ReturnOperand;
55}
56
57pub trait ViaTargetNode {
58    type ReturnOperand;
59
60    fn via_target_node(&self) -> Self::ReturnOperand;
61}