pulse_protocol/
lib.rs

1//! # pulse-protocol
2//!
3//! Wire protocol definitions for the Pulse realtime communication engine.
4//!
5//! This crate defines the binary protocol used for communication between
6//! Pulse clients and servers, including frame types, codecs, and versioning.
7//!
8//! ## Frame Types
9//!
10//! - `Subscribe` / `Unsubscribe` - Channel membership
11//! - `Publish` - Send messages to channels
12//! - `Presence` - Track online users
13//! - `Ack` / `Error` - Acknowledgments and errors
14//!
15//! ## Example
16//!
17//! ```rust
18//! use pulse_protocol::{Frame, codec};
19//!
20//! // Create a publish frame using the helper method
21//! let frame = Frame::publish("chat:lobby", b"Hello, world!".to_vec());
22//!
23//! // Encode and decode
24//! let encoded = codec::encode(&frame).unwrap();
25//! let decoded = codec::decode(&encoded).unwrap();
26//! ```
27
28pub mod codec;
29pub mod frames;
30pub mod version;
31
32pub use codec::{decode, encode, ProtocolError};
33pub use frames::{Frame, PresenceAction};
34pub use version::{Version, PROTOCOL_VERSION};