pub struct GatewayEventData { /* private fields */ }Expand description
Decoded gateway event payload: sequence number, event kind, and body.
Implementations§
Source§impl GatewayEventData
impl GatewayEventData
Sourcepub fn from_event(event: &GatewayEvent) -> Self
pub fn from_event(event: &GatewayEvent) -> Self
Extracts the streaming-relevant fields from a GatewayEvent.
Sourcepub fn from_packet(packet: &StreamPacket) -> Result<Self>
pub fn from_packet(packet: &StreamPacket) -> Result<Self>
Decodes gateway event data from a stream data packet, erroring if the packet is not a data packet of the gateway event kind.
Trait Implementations§
Source§impl Clone for GatewayEventData
impl Clone for GatewayEventData
Source§fn clone(&self) -> GatewayEventData
fn clone(&self) -> GatewayEventData
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 GatewayEventData
impl Debug for GatewayEventData
impl Eq for GatewayEventData
Source§impl PartialEq for GatewayEventData
impl PartialEq for GatewayEventData
Source§fn eq(&self, other: &GatewayEventData) -> bool
fn eq(&self, other: &GatewayEventData) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GatewayEventData
Auto Trait Implementations§
impl Freeze for GatewayEventData
impl RefUnwindSafe for GatewayEventData
impl Send for GatewayEventData
impl Sync for GatewayEventData
impl Unpin for GatewayEventData
impl UnsafeUnpin for GatewayEventData
impl UnwindSafe for GatewayEventData
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