pub enum PacketData {
Connect(Option<Value>),
Disconnect,
Event(Value, Option<i64>),
EventAck(Value, i64),
ConnectError(String),
BinaryEvent(Value, Option<i64>),
BinaryAck(Value, i64),
}
Expand description
Type | ID | Usage |
---|---|---|
CONNECT | 0 | Used during the connection to a namespace. |
DISCONNECT | 1 | Used when disconnecting from a namespace. |
EVENT | 2 | Used to send data to the other side. |
ACK | 3 | Used to acknowledge an event. |
CONNECT_ERROR | 4 | Used during the connection to a namespace. |
BINARY_EVENT | 5 | Used to send binary data to the other side. |
BINARY_ACK | 6 | Used to acknowledge an event (the response includes binary data). |
Variants§
Connect(Option<Value>)
Connect packet with optional payload (only used with v5 for response)
Disconnect
Disconnect packet, used to disconnect from a namespace
Event(Value, Option<i64>)
Event packet with optional ack id, to request an ack from the other side
EventAck(Value, i64)
Event ack packet, to acknowledge an event
ConnectError(String)
Connect error packet, sent when the namespace is invalid
BinaryEvent(Value, Option<i64>)
Binary event packet with optional ack id, to request an ack from the other side
BinaryAck(Value, i64)
Binary ack packet, to acknowledge an event with binary data
Implementations§
Source§impl PacketData
impl PacketData
Sourcepub fn set_ack_id(&mut self, ack_id: i64)
pub fn set_ack_id(&mut self, ack_id: i64)
Set the ack id for the packet It will only set the ack id for the packets that support it
Trait Implementations§
Source§impl Clone for PacketData
impl Clone for PacketData
Source§fn clone(&self) -> PacketData
fn clone(&self) -> PacketData
Returns a copy 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 PacketData
impl Debug for PacketData
Source§impl PartialEq for PacketData
impl PartialEq for PacketData
impl StructuralPartialEq for PacketData
Auto Trait Implementations§
impl !Freeze for PacketData
impl RefUnwindSafe for PacketData
impl Send for PacketData
impl Sync for PacketData
impl Unpin for PacketData
impl UnwindSafe for PacketData
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