Trait Codec
pub trait Codec {
// Required methods
fn encode<I>(input: I) -> JsValue
where I: Serialize;
fn decode<O>(input: JsValue) -> O
where O: for<'de> Deserialize<'de>;
}
Expand description
Message Encoding and Decoding Format
Required Methods§
fn decode<O>(input: JsValue) -> Owhere
O: for<'de> Deserialize<'de>,
fn decode<O>(input: JsValue) -> Owhere
O: for<'de> Deserialize<'de>,
Decode a message to a type
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.