antenna_protocol/lib.rs
1//! SansIO core of the [antenna](https://crates.io/crates/antenna) P2P mesh SDK.
2//!
3//! This crate is the platform-independent engine that drives every antenna
4//! peer. It contains no network, no async runtime, no WebRTC — only a
5//! synchronous state machine that turns [`Input`] events into [`Output`]
6//! commands. Platform drivers (`antenna-client-web`, `antenna-client-native`)
7//! wrap it and perform the actual I/O.
8//!
9//! The full protocol — handshake
10//! modes, relay, reconnection, mesh-completeness guarantees — is described
11//! in [`docs/protocol.md`](https://github.com/PixelQuasar/antenna/blob/main/docs/protocol.md).
12
13mod handshake;
14mod identity;
15mod mesh;
16mod state;
17#[cfg(test)]
18mod test;
19mod utils;
20
21pub use handshake::{
22 HandshakeFSM, HandshakeInput, HandshakeMode, HandshakeOutput, HandshakeState,
23 HandshakeStrategy, Host, Joiner, SignalingPayload,
24};
25pub use identity::{Identity, PeerID};
26pub use mesh::{FSMState, MeshNodeFSM};
27pub use state::{Input, MsgPayload, Output, RelayPayload, Scheduled, UserMsgPayload};
28pub(crate) use utils::{
29 MAX_RECONNECT_ATTEMPTS, RECONNECT_INTERVAL_MS, deserialize_base64_keypair,
30 deserialize_base64_pubkey, deserialize_base64_vec, serialize_base64_keypair,
31 serialize_base64_pubkey, serialize_base64_vec,
32};