use graph_api_lib::Graph;
use graph_api_simplegraph::SimpleGraph;
use graph_api_test::{Edge, Vertex, populate_graph};
type MyGraph = SimpleGraph<Vertex, Edge>;
type MyGraphVertexId = <SimpleGraph<Vertex, Edge> as Graph>::VertexId;
fn main() {
let mut graph = SimpleGraph::new();
let refs = populate_graph(&mut graph);
example(graph, refs.bryn);
}
fn example(graph: MyGraph, bryn_id: MyGraphVertexId) {
let projects = graph
.walk()
.vertices_by_id(vec![bryn_id])
.edges(Edge::created())
.tail()
.collect::<Vec<_>>();
assert!(!projects.is_empty());
let friends = graph
.walk()
.vertices_by_id(vec![bryn_id])
.edges(Edge::knows())
.tail()
.collect::<Vec<_>>();
assert!(!friends.is_empty());
}