pub enum PacketBody {
ApiRequest {
request_id: String,
route: String,
params: Value,
attachments: Vec<FileAttachment>,
metadata: Value,
},
ApiResponse {
request_id: String,
ok: bool,
status: u16,
data: Value,
error: Option<ErrorPayload>,
metadata: Value,
},
EventEmit {
event_id: String,
name: String,
data: Value,
attachments: Vec<FileAttachment>,
metadata: Value,
expect_ack: bool,
},
EventAck {
event_id: String,
ok: bool,
receipt: Value,
error: Option<ErrorPayload>,
},
}Expand description
JSON-level message body transported inside a WSCALL frame.
Variants§
ApiRequest
Client-to-server API request.
Fields
§
attachments: Vec<FileAttachment>ApiResponse
Server-to-client API response.
Fields
§
error: Option<ErrorPayload>EventEmit
Event emission in either direction.
Fields
§
attachments: Vec<FileAttachment>EventAck
Acknowledgement for an emitted event.
Implementations§
Source§impl PacketBody
impl PacketBody
pub fn message_type(&self) -> MessageType
Trait Implementations§
Source§impl Clone for PacketBody
impl Clone for PacketBody
Source§fn clone(&self) -> PacketBody
fn clone(&self) -> PacketBody
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 moreSource§impl Debug for PacketBody
impl Debug for PacketBody
Source§impl<'de> Deserialize<'de> for PacketBody
impl<'de> Deserialize<'de> for PacketBody
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 PacketBody
impl RefUnwindSafe for PacketBody
impl Send for PacketBody
impl Sync for PacketBody
impl Unpin for PacketBody
impl UnsafeUnpin for PacketBody
impl UnwindSafe for PacketBody
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