1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use gremlin_client::{ConnectionOptions, GremlinClient, Vertex};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = GremlinClient::connect(
        ConnectionOptions::builder()
            .host("localhost")
            .port(8182)
            .pool_size(1)
            .credentials("stephen", "password")
            .build(),
    )?;

    let results = client
        .execute("g.V(param)", &[("param", &1)])?
        .filter_map(Result::ok)
        .map(|f| f.take::<Vertex>())
        .collect::<Result<Vec<Vertex>, _>>()?;

    println!("{:?}", results);

    Ok(())
}