refactor: reorganize API and WebSocket modules

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.
This commit is contained in:
2026-07-19 22:31:47 -07:00
parent c5db920738
commit b3e3a3c87c
33 changed files with 2956 additions and 2712 deletions
+20
View File
@@ -0,0 +1,20 @@
//! 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;