Expand description
GWP: a standalone, pure Rust gRPC wire protocol for GQL (ISO/IEC 39075).
This crate provides the protobuf type definitions, gRPC service implementations, and client library for communicating GQL queries and results over the wire.
§Quick start (server)
use std::net::SocketAddr;
use gwp::server::{GqlServer, GqlBackend};
let addr: SocketAddr = "0.0.0.0:7687".parse().unwrap();
GqlServer::builder(backend)
.max_sessions(128)
.shutdown(async { drop(tokio::signal::ctrl_c().await) })
.serve(addr)
.await?;§Quick start (client)
use gwp::client::GqlConnection;
let mut conn = GqlConnection::connect("http://localhost:7687").await?;
let mut session = conn.create_session().await?;
let mut cursor = session.execute_simple("MATCH (n:Person) RETURN n.name").await?;
let rows = cursor.collect_rows().await?;
for row in &rows {
println!("{:?}", row);
}
session.close().await?;Modules§
- client
- Ergonomic Rust client for the GQL wire protocol.
- error
- Crate error types for the GQL wire protocol.
- proto
- Generated protobuf types and gRPC service definitions.
- server
- gRPC server implementation.
- status
- GQLSTATUS code constants and helpers (ISO/IEC 39075 Chapter 23).
- types
- Ergonomic Rust types for the GQL type system.