Split client, endpoint, and WebSocket implementations into domain-focused modules while preserving the public API.\n\nImprove crate and API documentation to describe responsibilities, authentication boundaries, and response compatibility.
21 lines
632 B
Rust
21 lines
632 B
Rust
//! Bilibili 直播 WebSocket 协议支持。
|
|
//!
|
|
//! 本模块将传输数据包、连接生命周期和业务命令分离:二进制数据包支持压缩载荷,
|
|
//! 连接实现认证、心跳与事件读取,业务命令则转换为强类型事件。
|
|
//!
|
|
//! [LiveWebSocket] 是面向在线消费的入口;[decode_events] 可用于离线重放已捕获的原始帧。
|
|
|
|
mod command;
|
|
mod connection;
|
|
mod packet;
|
|
|
|
pub use command::*;
|
|
pub use connection::LiveWebSocket;
|
|
pub use packet::{decode_events, decode_packets, LiveEvent, Packet};
|
|
|
|
#[cfg(test)]
|
|
use packet::{encode_packet, events_from_packets};
|
|
|
|
#[cfg(test)]
|
|
mod tests;
|