thunder/lib.rs
1//! HiveLLM binary RPC — **one crate** for the whole Rust stack.
2//!
3//! Thunder ships as a single publishable crate with three feature-gated
4//! layers, so a product depends on `thunder` once instead of tracking
5//! `thunder-wire` / `thunder-client` / `thunder-server` as separate
6//! releases:
7//!
8//! - [`wire`] — the frozen wire v1 codec (value model, `Request`/`Response`,
9//! length-prefixed MessagePack frames). Always compiled; pure, no sockets
10//! (SPEC-001, `WIRE-xxx`).
11//! - [`client`] — the multiplexed, profile-driven RPC client (SPEC-003,
12//! `CLT-xxx`). Feature `client` (default on).
13//! - [`server`] — the family server hot path: accept loop, dispatch trait,
14//! profile enforcement (SPEC-004, `SRV-xxx`). Feature `server` (default on).
15//!
16//! Both `client` and `server` are on by default. A client-only SDK builds
17//! with `default-features = false, features = ["client"]`; a server binary
18//! with `["server"]`. The wire layer alone is `default-features = false`.
19//!
20//! The most-used items are re-exported at the crate root; the full surface
21//! of each layer lives under its module. `client::Credentials` and
22//! `server::Credentials` are distinct types and are reached through their
23//! modules (they are deliberately not re-exported at the root).
24
25pub mod wire;
26
27pub use wire::{
28 decode_frame, decode_frame_with_limit, encode_frame, Config, DecodeError, Request, Response,
29 Value, DEFAULT_MAX_FRAME_BYTES, PUSH_ID,
30};
31
32#[cfg(feature = "client")]
33pub mod client;
34
35#[cfg(feature = "client")]
36pub use client::{parse_endpoint, Client, ClientConfig, ClientError, Endpoint, HandshakeInfo};
37
38#[cfg(feature = "server")]
39pub mod server;
40
41#[cfg(feature = "server")]
42pub use server::{
43 format_bracket_code, format_err, spawn_listener, AuthError, Dispatch, ListenerConfig,
44 ListenerHandle, MetricsSnapshot, Principal, PushClosed, PushSender, ServerInfo, Session,
45 NOAUTH, NOPERM, WRONGPASS,
46};