Expand description
The Aranya runtime.
§Overview
The runtime crate is the starting point for integrating with Aranya.
The runtime provides a higher level interface to:
- An
Engineresponsible for enforcing aPolicyon graphCommands. - A
StorageProviderresponsible for providing a storage mechanism for graph commands. - A
syncinterface responsible for syncing graph state between peers.
§Usage
Refer to provided demo/quickstart code for an example of how to use the runtime crate.
The quic_syncer.rs module provides a good example of syncing via QUIC.
§Example
Start by initializing a client with desired Engine and StorageProvider
ⓘ
let client = ClientState::new(engine, storage)Initialize graph for the client with:
ⓘ
client.new_graph(...)Start listening for incoming sync requests with:
ⓘ
sync::run_syncer(...)To initiate a sync with another peer, construct a SyncRequester
and send the sync request to the peer via the Aranya transport:
ⓘ
SyncRequester::new(...)
sync::sync(...)Re-exports§
pub use crate::command::*;pub use crate::engine::*;pub use crate::storage::*;pub use crate::sync::*;pub use crate::vm_policy::*;
Modules§
- command
- engine
- Interfaces for an application to begin a runtime.
- metrics
- Interface for collecting runtime metrics.
- storage
- Interfaces for graph storage.
- sync
- Interface for syncing state between clients.
- vm_
policy - VmPolicy implements a Policy that evaluates actions and commands via the Policy VM.
Macros§
- vm_
action - Creates a
VmAction. - vm_
effect - Creates a
VmEffectData.
Structs§
- Client
State - Keeps track of client graph state.
- Session
- Ephemeral session used to handle/generate off-graph commands.
- Transaction
- Transaction used to receive many commands at once.
Enums§
- Client
Error - An error returned by the runtime client.
- Prior
- Refer to immediately prior commands in a graph, usually via
Prior<CmdId>orPrior<Location>.