pub enum WsIoPacketCodec {
SerdeJson,
}Variants§
SerdeJson
Implementations§
Source§impl WsIoPacketCodec
impl WsIoPacketCodec
pub fn decode(&self, bytes: &[u8]) -> Result<WsIoPacket>
pub fn decode_data<D: DeserializeOwned>(&self, bytes: &[u8]) -> Result<D>
pub fn encode(&self, packet: &WsIoPacket) -> Result<Vec<u8>>
pub fn encode_data<D: Serialize>(&self, data: &D) -> Result<Vec<u8>>
pub fn is_text(&self) -> bool
Trait Implementations§
Source§impl Clone for WsIoPacketCodec
impl Clone for WsIoPacketCodec
Source§fn clone(&self) -> WsIoPacketCodec
fn clone(&self) -> WsIoPacketCodec
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 WsIoPacketCodec
impl Debug for WsIoPacketCodec
impl Copy for WsIoPacketCodec
Auto Trait Implementations§
impl Freeze for WsIoPacketCodec
impl RefUnwindSafe for WsIoPacketCodec
impl Send for WsIoPacketCodec
impl Sync for WsIoPacketCodec
impl Unpin for WsIoPacketCodec
impl UnwindSafe for WsIoPacketCodec
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