pub struct JsonCodec { /* private fields */ }Available on crate feature
serde-json only.Expand description
JSON codec using serde_json.
By default, values are encoded as text frames.
Implementations§
Trait Implementations§
Source§impl<T> MessageCodec<T> for JsonCodecwhere
T: Serialize + DeserializeOwned,
impl<T> MessageCodec<T> for JsonCodecwhere
T: Serialize + DeserializeOwned,
Source§fn encode(&self, item: &T) -> Result<EncodedMessage, Self::Error>
fn encode(&self, item: &T) -> Result<EncodedMessage, Self::Error>
Encodes a value into a WebSocket text or binary message.
Source§fn decode(&self, msg: AggregatedMessage) -> Result<CodecMessage<T>, Self::Error>
fn decode(&self, msg: AggregatedMessage) -> Result<CodecMessage<T>, Self::Error>
Decodes an incoming WebSocket message into a typed value or a control message.
impl Copy for JsonCodec
Auto Trait Implementations§
impl Freeze for JsonCodec
impl RefUnwindSafe for JsonCodec
impl Send for JsonCodec
impl Sync for JsonCodec
impl Unpin for JsonCodec
impl UnsafeUnpin for JsonCodec
impl UnwindSafe for JsonCodec
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