pub enum CommandResponse {
Ok {
id: i32,
},
Error {
code: i32,
msg: String,
},
Subscribed {
sid: i32,
channel: String,
},
}Expand description
Response from a WebSocket command.
When you send commands to the WebSocket server (subscribe, unsubscribe, etc.), the server responds with one of these message types to confirm or reject the action.
§Variants
Ok: Command was successfulError: Command failed (includes error code and message)Subscribed: Subscription confirmed (includes subscription ID and channel name)
Variants§
Ok
Error
Subscribed
Subscription confirmation with assigned subscription ID.
§Fields
sid: Subscription ID assigned by the serverchannel: The channel name that was subscribed to
Trait Implementations§
Source§impl Clone for CommandResponse
impl Clone for CommandResponse
Source§fn clone(&self) -> CommandResponse
fn clone(&self) -> CommandResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CommandResponse
impl RefUnwindSafe for CommandResponse
impl Send for CommandResponse
impl Sync for CommandResponse
impl Unpin for CommandResponse
impl UnwindSafe for CommandResponse
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