pub struct Envelope {
pub msg_type: String,
pub request_id: Option<String>,
pub payload: Value,
}Fields§
§msg_type: String§request_id: Option<String>§payload: ValueImplementations§
Source§impl Envelope
impl Envelope
pub fn request( msg_type: impl Into<String>, request_id: String, payload: Value, ) -> Self
pub fn event(msg_type: impl Into<String>, payload: Value) -> Self
pub fn response(request_id: String, payload: Value) -> Self
pub fn error(request_id: Option<String>, code: &str, message: &str) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Envelope
impl<'de> Deserialize<'de> for Envelope
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
impl StructuralPartialEq for Envelope
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
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