[−][src]Struct websocket_codec::MessageCodec
Tokio codec for WebSocket messages. This codec can send and receive Message
structs.
Implementations
impl MessageCodec
[src]
pub fn client() -> Self
[src]
Creates a MessageCodec
for a client.
Encoded messages are masked.
pub fn server() -> Self
[src]
Creates a MessageCodec
for a server.
Encoded messages are not masked.
pub fn with_masked_encode(use_mask: bool) -> Self
[src]
Creates a MessageCodec
while specifying whether to use message masking while encoding.
Trait Implementations
impl Clone for MessageCodec
[src]
fn clone(&self) -> MessageCodec
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Decoder for MessageCodec
[src]
type Item = Message
The type of decoded frames.
type Error = Error
The type of unrecoverable frame decoding errors. Read more
fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Message>>
[src]
fn decode_eof(
&mut self,
buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
[src]
&mut self,
buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
fn framed<T>(self, io: T) -> Framed<T, Self> where
T: AsyncRead + AsyncWrite,
[src]
T: AsyncRead + AsyncWrite,
impl<'a> Encoder<&'a Message> for MessageCodec
[src]
type Error = Error
The type of encoding errors. Read more
fn encode(&mut self, item: &Message, dst: &mut BytesMut) -> Result<()>
[src]
impl Encoder<Message> for MessageCodec
[src]
Auto Trait Implementations
impl RefUnwindSafe for MessageCodec
impl Send for MessageCodec
impl Sync for MessageCodec
impl Unpin for MessageCodec
impl UnwindSafe for MessageCodec
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,