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>;
}
Available on crate feature worker only.
Expand description

Message Encoding and Decoding Format

Required Methods§

source

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

Encode an input to JsValue

source

fn decode<O>(input: JsValue) -> Owhere O: for<'de> Deserialize<'de>,

Decode a message to a type

Implementors§