Crate evidentsource_client

Crate evidentsource_client 

Source
Expand description

§EvidentSource Client

A Rust client for connecting to EvidentSource event sourcing servers.

§API Layers

This crate provides two API layers:

The client module provides an ergonomic, type-safe API using domain types:

use evidentsource_client::client::{EvidentSource, Connection};
use evidentsource_client::client::{DatabaseName, ProspectiveEvent};

let es = EvidentSource::connect_to_server("http://localhost:50051").await?;
let conn = es.connect(&DatabaseName::new("my-db")?).await?;
let db = conn.latest_database().await?;

§Low-level gRPC API (advanced)

The grpc module provides direct access to protocol buffer types:

use evidentsource_client::grpc::{EvidentSourceClient, proto};

let mut client = EvidentSourceClient::new("http://localhost:50051").await?;
let db = client.fetch_latest_database("my-db".into()).await?;

Re-exports§

pub use client::Connection;
pub use client::EvidentSource;

Modules§

client
High-level client API using domain types.
grpc
Low-level gRPC API for direct protocol buffer access.
prelude
Prelude module for convenient imports.

Structs§

AuthInterceptor
Tonic interceptor that injects authentication headers into gRPC requests.
DevModeCredentials
DevMode credentials for local development and testing.
EvidentSourceClient

Enums§

Credentials
Credentials for authenticating with EvidentSource server.
Error