Struct miraie::bot::Connection [−][src]
pub struct Connection { /* fields omitted */ }
Expand description
Connection 负责使用 ws 协议跟 mirai 沟通。
当接收到 mirai 通过 ws 发过来的包时,它会判断是命令的返回值(response) 还是接收到的推送消息。
- 如果是接收到的推送消息,它会将其解析成
Message
并将其发布到 message_channel。 - 如果是命令的返回值,它会通过 syncId 找到对应的 oneshot channel 并塞进去。
Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection