Trait wasm_rs_shared_channel::Shareable[][src]

pub trait Shareable: Sized {
    type Error: Error;
    fn to_bytes(&self) -> Result<Uint8Array, Self::Error>;
fn from(bytes: &Uint8Array) -> Result<Result<Self, Expects>, Self::Error>; }

Any type that can be sent through a shared channel must implement this

Associated Types

type Error: Error[src]

A generic error

Loading content...

Required methods

fn to_bytes(&self) -> Result<Uint8Array, Self::Error>[src]

Converts value into a js_sys::Uint8Array

fn from(bytes: &Uint8Array) -> Result<Result<Self, Expects>, Self::Error>[src]

Converts js_sys::Uint8Array into a value

Loading content...


impl<T> Shareable for T where
    T: Serialize + Deserialize<'a>, 

type Error = Error

Loading content...