pub enum CloseCode {
NormalClosure,
GoingAway,
ProtocolError,
UnsupportedData,
NoStatusReceived,
AbnormalClosure,
InvalidPayloadData,
PolicyViolation,
MessageTooBig,
MandatoryExtension,
InternalError,
Other(u16),
}Variants§
NormalClosure
1000: 正常关闭
GoingAway
1001: 端点离开 (如服务器关闭或浏览器导航离开)
ProtocolError
1002: 协议错误
UnsupportedData
1003: 不支持的数据类型
NoStatusReceived
1005: 未收到状态码 (保留,不应发送)
AbnormalClosure
1006: 异常关闭 (保留,不应发送)
InvalidPayloadData
1007: 无效的帧 payload 数据 (如非 UTF-8 文本)
PolicyViolation
1008: 策略违规
MessageTooBig
1009: 消息过大
MandatoryExtension
1010: 缺少必需的扩展
InternalError
1011: 内部服务器错误
Other(u16)
其它关闭码
Implementations§
Trait Implementations§
impl Eq for CloseCode
impl StructuralPartialEq for CloseCode
Auto Trait Implementations§
impl Freeze for CloseCode
impl RefUnwindSafe for CloseCode
impl Send for CloseCode
impl Sync for CloseCode
impl Unpin for CloseCode
impl UnsafeUnpin for CloseCode
impl UnwindSafe for CloseCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more