pub struct MessageCodec { /* private fields */ }
Expand description
Tokio codec for WebSocket messages. This codec can send and receive Message
structs.
Implementations§
Source§impl MessageCodec
impl MessageCodec
Sourcepub fn with_masked_encode(use_mask: bool) -> Self
pub fn with_masked_encode(use_mask: bool) -> Self
Creates a MessageCodec
while specifying whether to use message masking while encoding.
Trait Implementations§
Source§impl Clone for MessageCodec
impl Clone for MessageCodec
Source§fn clone(&self) -> MessageCodec
fn clone(&self) -> MessageCodec
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 Decoder for MessageCodec
impl Decoder for MessageCodec
Source§type Error = Box<dyn Error + Sync + Send>
type Error = Box<dyn Error + Sync + Send>
The type of unrecoverable frame decoding errors. Read more
Source§fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Message>>
fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Message>>
Attempts to decode a frame from the provided buffer of bytes. Read more
Source§impl<'a> Encoder<&'a Message> for MessageCodec
impl<'a> Encoder<&'a Message> for MessageCodec
Auto Trait Implementations§
impl Freeze for MessageCodec
impl RefUnwindSafe for MessageCodec
impl Send for MessageCodec
impl Sync for MessageCodec
impl Unpin for MessageCodec
impl UnwindSafe for MessageCodec
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