Skip to main content

aven_core/sync/
client.rs

1//! The end-to-end encrypted sync client shared by every host.
2//!
3//! Hosts run [`engine`] operations as sans-IO [`Session`]s, persist
4//! protected keys through [`keys::ProtectedStorage`] and supply policy,
5//! storage and paths through [`ClientHost`].
6
7/// Evaluates `$attempt`, and once more after `$refresh` if the server
8/// reported a stale membership context. Both are awaited expressions.
9macro_rules! retry_stale {
10    ($attempt:expr, $refresh:expr $(,)?) => {
11        match $attempt {
12            Err(error) if $crate::sync::client::errors::is_stale(&error) => {
13                $refresh?;
14                $attempt
15            }
16            result => result,
17        }
18    };
19}
20
21pub mod bootstrap;
22pub mod coordination;
23mod device_label;
24pub mod engine;
25pub mod enrollment;
26pub mod errors;
27mod exchange;
28mod host;
29pub mod invitation;
30pub mod keys;
31mod origin;
32pub mod tail;
33
34pub use exchange::{
35    HttpHeader, HttpResponse, Link, PreparedRequest, RequestContext, Session, Step,
36};
37pub use host::ClientHost;
38pub use invitation::{DeviceInvitation, InvitationCheck, SetupInvitation};
39pub use origin::{MAX_SERVER_BYTES, is_aven_cloud, server_origin};