pub struct CommandPayload<'a, T> { /* private fields */ }Expand description
The {"op": …, "d": …} envelope around a GatewayCommand, ready to be serialized.
discord.js counterpart: GatewaySendPayload (discord-api-types), with its op.
§Examples
use djs_model::gateway::payload::{CommandPayload, Heartbeat};
let json = serde_json::to_string(&CommandPayload::new(&Heartbeat(Some(251)))).unwrap();
assert_eq!(json, r#"{"op":1,"d":251}"#);Implementations§
Source§impl<'a, T: GatewayCommand> CommandPayload<'a, T>
impl<'a, T: GatewayCommand> CommandPayload<'a, T>
Trait Implementations§
Source§impl<'a, T: Debug> Debug for CommandPayload<'a, T>
impl<'a, T: Debug> Debug for CommandPayload<'a, T>
Source§impl<T: GatewayCommand> Serialize for CommandPayload<'_, T>
impl<T: GatewayCommand> Serialize for CommandPayload<'_, T>
Auto Trait Implementations§
impl<'a, T> Forget for CommandPayload<'a, T>
impl<'a, T> Freeze for CommandPayload<'a, T>
impl<'a, T> Move for CommandPayload<'a, T>
impl<'a, T> RefUnwindSafe for CommandPayload<'a, T>where
&'a T: RefUnwindSafe,
impl<'a, T> Send for CommandPayload<'a, T>
impl<'a, T> Sync for CommandPayload<'a, T>
impl<'a, T> Unpin for CommandPayload<'a, T>
impl<'a, T> UnsafeUnpin for CommandPayload<'a, T>where
&'a T: UnsafeUnpin,
impl<'a, T> UnwindSafe for CommandPayload<'a, T>where
&'a T: UnwindSafe,
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