pub enum WsServerMessage {
Output {
data: String,
is_final: bool,
},
Result {
success: bool,
exit_code: Option<i32>,
duration_ms: u64,
timed_out: bool,
total_bytes: u64,
},
Error {
code: String,
message: String,
},
Ping,
Pong,
}Expand description
A message the server sends to a WebSocket client.
Deliberately not deny_unknown_fields: this is the type a consumer
deserialises the server’s output with, and a new field on a later server
must not make an older consumer reject the whole message. The strictness
that fixes silently-dropped input belongs on WsClientMessage only.
Variants§
Output
One chunk of a running command’s output.
Result
Terminal result of an execution.
Carries total_bytes but not truncated, unlike the REST response:
every chunk reaches a streaming consumer as it arrives, so there is
nothing here for a cap to discard. The figure is what a consumer needs
to confirm it received the whole stream.
Error
Error message.
Ping
Connection health.
Pong
Trait Implementations§
Source§impl Clone for WsServerMessage
impl Clone for WsServerMessage
Source§fn clone(&self) -> WsServerMessage
fn clone(&self) -> WsServerMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WsServerMessage
impl Debug for WsServerMessage
Source§impl<'de> Deserialize<'de> for WsServerMessage
impl<'de> Deserialize<'de> for WsServerMessage
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 WsServerMessage
impl RefUnwindSafe for WsServerMessage
impl Send for WsServerMessage
impl Sync for WsServerMessage
impl Unpin for WsServerMessage
impl UnsafeUnpin for WsServerMessage
impl UnwindSafe for WsServerMessage
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