aranya_runtime/
lib.rs

1//! The Aranya runtime.
2//!
3//! # Overview
4//!
5//! The runtime crate is the starting point for integrating with Aranya.
6//!
7//! The runtime provides a higher level interface to:
8//! 1. An [`Engine`] responsible for enforcing a [`Policy`] on graph [`Command`]s.
9//! 2. A [`StorageProvider`] responsible for providing a storage mechanism for graph commands.
10//! 3. A [`sync`] interface responsible for syncing graph state between peers.
11//!
12//! # Usage
13//!
14//! Refer to provided demo/quickstart code for an example of how to use the runtime crate.
15//! The `quic_syncer.rs` module provides a good example of syncing via QUIC.
16//!
17//! # Example
18//!
19//! Start by initializing a client with desired [`Engine`] and [`StorageProvider`]
20//! ```ignore
21//! let client = ClientState::new(engine, storage)
22//! ```
23//!
24//! Initialize graph for the client with:
25//! ```ignore
26//! client.new_graph(...)
27//! ```
28//!
29//! Start listening for incoming sync requests with:
30//! ```ignore
31//! sync::run_syncer(...)
32//! ```
33//!
34//! To initiate a sync with another peer, construct a [`SyncRequester`]
35//! and send the sync request to the peer via the Aranya transport:
36//! ```ignore
37//! SyncRequester::new(...)
38//! sync::sync(...)
39//! ```
40
41#![cfg_attr(docsrs, feature(doc_cfg))]
42#![cfg_attr(not(any(test, doctest, feature = "std")), no_std)]
43
44extern crate alloc;
45
46mod client;
47pub mod command;
48pub mod engine;
49pub mod metrics;
50mod prior;
51pub mod storage;
52pub mod sync;
53pub mod testing;
54pub mod vm_policy;
55
56pub use crate::{
57    client::*, command::*, engine::*, prior::Prior, storage::*, sync::*, vm_policy::*,
58};