pub enum Payload {
Binary(Bytes),
Text(Vec<Value>),
String(String),
}
Expand description
A type which represents a payload
in the socket.io
context.
A payload could either be of the type Payload::Binary
, which holds
data in the Bytes
type that represents the payload or of the type
Payload::String
which holds a std::string::String
. The enum is
used for both representing data that’s send and data that’s received.
Variants§
Binary(Bytes)
Text(Vec<Value>)
String(String)
👎Deprecated: Use
Payload::Text
instead. Continue existing behavior with: Payload::from(String)String that is sent as JSON if this is a JSON string, or as a raw string if it isn’t
Trait Implementations§
impl Eq for Payload
impl StructuralPartialEq for Payload
Auto Trait Implementations§
impl !Freeze for Payload
impl RefUnwindSafe for Payload
impl Send for Payload
impl Sync for Payload
impl Unpin for Payload
impl UnwindSafe for Payload
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.