#[repr(i32)]pub enum ResCode {
Show 23 variants
Success = 0,
UnknownCode = 1,
ConnectionClosed = 2,
ConnectionNotFound = 3,
DecodeError = 4,
EncodeError = 5,
WebsocketError = 6,
InvalidMessageType = 7,
BusinessError = 8,
ProtocolError = 9,
AuthError = 10,
NotFoundHandler = 11,
PushToClientError = 12,
SendMessageError = 13,
InvalidParams = 14,
InvalidCommand = 15,
Unauthorized = 16,
InternalError = 17,
InvalidState = 18,
Timeout = 19,
ResourceError = 20,
ConnectionError = 21,
ArgsError = 22,
}Expand description
消息响应码
Variants§
Success = 0
成功
UnknownCode = 1
未知错误
ConnectionClosed = 2
连接关闭
ConnectionNotFound = 3
连接不存在
DecodeError = 4
解码错误
EncodeError = 5
编码错误
WebsocketError = 6
WebSocket错误
InvalidMessageType = 7
无效消息类型
BusinessError = 8
业务错误
ProtocolError = 9
协议错误
AuthError = 10
认证错误
NotFoundHandler = 11
未找到处理器
PushToClientError = 12
推送客户端错误
SendMessageError = 13
发送消息错误
InvalidParams = 14
无效参数
InvalidCommand = 15
无效命令
未授权
InternalError = 17
内部错误
InvalidState = 18
无效状态
Timeout = 19
超时
ResourceError = 20
资源错误
ConnectionError = 21
连接错误
ArgsError = 22
参数错误
Implementations§
Source§impl ResCode
impl ResCode
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Ord for ResCode
impl Ord for ResCode
Source§impl PartialOrd for ResCode
impl PartialOrd for ResCode
impl Copy for ResCode
impl Eq for ResCode
impl StructuralPartialEq for ResCode
Auto Trait Implementations§
impl Freeze for ResCode
impl RefUnwindSafe for ResCode
impl Send for ResCode
impl Sync for ResCode
impl Unpin for ResCode
impl UnwindSafe for ResCode
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