1use gremlin_client::{Edge, GremlinClient};
2
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let client = GremlinClient::connect("localhost")?;
5
6 let results = client
8 .execute("g.V(param).outE()", &[("param", &1)])?
9 .filter_map(Result::ok)
10 .map(|f| f.take::<Edge>())
11 .collect::<Result<Vec<Edge>, _>>()?;
12
13 println!("Edges count {}", results.len());
14
15 let first = &results[0];
16
17 println!(
18 "Edge with id: [{}] and label: [{}] from: [{}] to: [{}]",
19 first.id().get::<i32>()?,
20 first.label(),
21 first.out_v().id().get::<i64>()?,
22 first.in_v().id().get::<i64>()?
23 );
24
25 Ok(())
26}