Trait gloo_worker::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

Object Safety§

This trait is not object safe.

Implementors§