Skip to main content

Crate boltr

Crate boltr 

Source
Expand description

BoltR: A pure-Rust Bolt v5.x wire protocol library.

This crate implements the Bolt binary protocol used by Neo4j and compatible graph databases. It provides both server and client components for building Bolt-compatible applications.

§Quick start (server)

use std::net::SocketAddr;
use boltr::server::{BoltServer, BoltBackend};

let addr: SocketAddr = "127.0.0.1:7687".parse().unwrap();
BoltServer::builder(backend)
    .max_sessions(100)
    .serve(addr)
    .await?;

§Quick start (client)

use boltr::client::BoltSession;

let addr = "127.0.0.1:7687".parse().unwrap();
let mut session = BoltSession::connect(addr).await?;
let result = session.run("RETURN 1 AS n").await?;

for record in &result.records {
    println!("{:?}", record);
}

session.close().await?;

§Architecture

  • packstream, binary encoding/decoding (PackStream format)
  • chunk, message framing (2-byte length-prefixed chunks)
  • message, protocol message types and serialization
  • types, Bolt value types (scalars, graph structures, temporal, spatial)
  • server, server framework with BoltBackend trait
  • client, client for connecting to Bolt servers (feature-gated)

Re-exports§

pub use error::BoltError;
pub use server::AuthInfo;
pub use server::AuthValidator;
pub use server::BoltBackend;
pub use server::BoltRecord;
pub use server::BoltServer;
pub use server::ResultStream;
pub use server::SessionHandle;
pub use server::TransactionHandle;
pub use types::BoltValue;

Modules§

chunk
Bolt message chunking: 2-byte length-prefixed framing over TCP.
error
Error types for the Bolt protocol.
message
Bolt protocol messages.
packstream
PackStream binary encoding format for the Bolt protocol.
server
Bolt server framework.
types
Bolt protocol value types and graph structures.
version
Bolt protocol version negotiation.