pub struct WsError {
pub msg_type: String,
pub code: String,
pub message: String,
}Expand description
An error frame of the broker ("type": "error"), the server to client direction.
A frame like this is parsed into IncomingMessage::Error.
§Examples
use brokapi_bcs_protocol::ws::models::WsError;
let e: WsError = serde_json::from_str(r#"{"type":"error","code":"UNAUTHORIZED","message":"no token"}"#)?;
assert_eq!(e.code, "UNAUTHORIZED");Fields§
§msg_type: StringKind of the frame (JSON field type), error for this type.
code: StringMachine code of the error.
message: StringText of the error.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WsError
impl<'de> Deserialize<'de> for WsError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WsError
impl RefUnwindSafe for WsError
impl Send for WsError
impl Sync for WsError
impl Unpin for WsError
impl UnsafeUnpin for WsError
impl UnwindSafe for WsError
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