1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//! High-level client API using domain types.
//!
//! This module provides an ergonomic, type-safe API for interacting with
//! EvidentSource using domain types from `evidentsource_core::domain`.
//!
//! # Overview
//!
//! The high-level API is organized around these main types:
//!
//! - [`EvidentSource`] - The main entrypoint for connecting to a server
//! - [`Connection`] - A live connection to a specific database
//! - Domain types from `evidentsource_core::domain` for events, conditions, etc.
//!
//! # Example
//!
//! ```rust,ignore
//! use evidentsource_client::client::{EvidentSource, Connection};
//! use evidentsource_core::domain::{DatabaseName, ProspectiveEvent, AppendCondition};
//!
//! // Connect to the server
//! let es = EvidentSource::connect_to_server("http://localhost:50051").await?;
//!
//! // List all databases
//! use futures::StreamExt;
//! let mut databases = es.list_databases();
//! while let Some(name) = databases.next().await {
//! println!("Database: {}", name);
//! }
//!
//! // Connect to a specific database
//! let db_name = DatabaseName::new("my-db")?;
//! let conn = es.connect(&db_name).await?;
//!
//! // Get the latest database state
//! let db = conn.latest_database().await?;
//! println!("Current revision: {}", db.revision());
//!
//! // Query state views
//! let summary = db.view_state(&StateViewName::new("account-summary")?, 1).await?;
//! ```
//!
//! # When to use this module
//!
//! This is the recommended API for most applications. It provides:
//!
//! - Type-safe domain types that prevent common errors
//! - Automatic conversion between protocol buffers and domain types
//! - An ergonomic, Rust-idiomatic interface
//!
//! # Low-level access
//!
//! If you need direct access to the gRPC protocol for advanced use cases,
//! see the [`crate::grpc`] module.
// Re-export the main entrypoint
pub use crate;
// Re-export authentication types
pub use crate;
// Re-export connection types
pub use crate;
// Re-export database types (traits and builders only - impl types are internal)
pub use crate;
// Re-export domain types for convenience
pub use ;
// Re-export commonly used external types
pub use ;
pub use NonEmpty;
// Re-export CloudEvents SDK conversion functions (feature-gated)
pub use crate;