Files
quicproquo/crates/quicprochat-rpc/src/lib.rs
Christian Nennemann c256c38ffb docs: add crate-level documentation and public API doc comments
- Expand crate-level docs for quicprochat-rpc (architecture, wire format,
  module map) and quicprochat-sdk (connection lifecycle, event subscription,
  module descriptions).
- Add /// doc comments to all undocumented pub fn/struct/enum items in
  server domain services (keys, channels, devices, users, account, p2p,
  blobs) and domain types.
- Fix rustdoc broken intra-doc links in plugin-api (HookResult,
  qpc_plugin_init), federation/mod.rs (Store), and client main.rs
  (unescaped brackets).
2026-03-21 19:14:07 +01:00

50 lines
1.9 KiB
Rust

//! QUIC RPC framework for quicprochat v2.
//!
//! This crate implements a lightweight, binary-framed RPC protocol over QUIC.
//! Each RPC call opens a new QUIC bi-directional stream, sends a request frame,
//! and reads a response frame. Server-initiated push events use uni-streams.
//!
//! # Wire format
//!
//! All integers are big-endian.
//!
//! **Request** (client → server, bi-stream):
//! ```text
//! [method_id: u16][request_id: u32][payload_len: u32][protobuf bytes]
//! ```
//!
//! **Response** (server → client, same bi-stream):
//! ```text
//! [status: u8][request_id: u32][payload_len: u32][protobuf bytes]
//! ```
//!
//! **Push** (server → client, uni-stream):
//! ```text
//! [event_type: u16][payload_len: u32][protobuf bytes]
//! ```
//!
//! # Architecture
//!
//! - [`framing`] — frame types ([`framing::RequestFrame`], [`framing::ResponseFrame`],
//! [`framing::PushFrame`]) and encode/decode logic.
//! - [`method`] — [`method::MethodRegistry`] maps `u16` method IDs to async handler
//! functions with optional per-method timeouts.
//! - [`server`] — [`server::RpcServer`] binds a QUIC endpoint, performs an auth
//! handshake on each connection, then dispatches RPC streams to registered handlers.
//! - [`client`] — [`client::RpcClient`] connects to the server with TLS, supports
//! auto-reconnect with exponential backoff, and multiplexes concurrent RPCs.
//! - [`push`] — [`push::PushBroker`] manages per-identity push connections and
//! fan-out to channel members.
//! - [`middleware`] — session validation, rate limiting, and structured audit logging.
//! - [`auth_handshake`] — initial session-token exchange on the first bi-stream.
//! - [`error`] — [`error::RpcError`] and [`error::RpcStatus`] types.
pub mod auth_handshake;
pub mod framing;
pub mod method;
pub mod server;
pub mod client;
pub mod middleware;
pub mod push;
pub mod error;