pub enum PacketData {
Plaintext(String),
Binary(Bytes),
Empty,
}Expand description
Use this enum to figure out if a packet in a payload has binary or string data. In string-encoded payloads, each packet may contain string or binary data. Binary data in string-encoded payloads is encoded to base64. Otherwise, string data is returned as is. In binary-encoded payloads, each packet may contain string or binary data. If a packet in a payload has string data, it’s parsed as a UTF-8 string.
Variants§
Trait Implementations§
Source§impl Clone for PacketData
impl Clone for PacketData
Source§fn clone(&self) -> PacketData
fn clone(&self) -> PacketData
Returns a duplicate 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 From<&[u8]> for PacketData
impl From<&[u8]> for PacketData
Source§impl From<&str> for PacketData
impl From<&str> for PacketData
Source§impl From<String> for PacketData
impl From<String> 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