yew_agent

Trait Codec

Source
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§

Source

fn encode<I>(input: I) -> JsValue
where I: Serialize,

Encode an input to JsValue

Source

fn decode<O>(input: JsValue) -> O
where 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.

Implementors§