Skip to main content

AirLibrary/Client/
mod.rs

1//! # Air::Client
2//!
3//! Client-side gRPC wrappers for callers that connect to Air's
4//! `AirService` server (Mountain in the editor process, external scripts,
5//! integration tests). Air owns `Air.proto` and the matching prost / tonic
6//! types under [`crate::Vine::Generated::air`]; this module wraps those
7//! generated types in an ergonomic façade.
8//!
9//! ## Layout
10//!
11//! - [`AirClient`] - low-level gRPC client wrapper. Holds an
12//!   `Arc<Mutex<AirServiceClient<Channel>>>` so clones share one channel.
13//!   Per-domain methods (authentication, updates, downloads, indexing,
14//!   monitoring) live as `impl AirClient` blocks in the same module.
15//! - [`AirServiceProvider`] - high-level surface that wraps [`AirClient`] with
16//!   automatic request-id generation, structured error translation, and
17//!   ergonomic per-operation method signatures.
18//!
19//! ## Threading model
20//!
21//! Cheap to clone (Arc ref-count bump). The interior `tokio::sync::Mutex`
22//! serialises concurrent RPCs on a single channel - tonic recommends this
23//! pattern for clients that are shared across many call sites.
24
25pub mod AirClient;
26
27pub mod AirServiceProvider;