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

阻塞等待跟 mirai-api-http 的连接关闭或者结束信号

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.