Skip to main content

Wire

Trait Wire 

Source
pub trait Wire: Sized {
    // Required methods
    fn write(&self, w: &mut Writer<'_>);
    fn read(r: &mut Reader<'_>) -> Option<Self>;
}
Expand description

A value that crosses between wasm instances.

read returns None when the value can’t be read, after it records why in the reader (Reader::fail): an Option takes less code to pass up through the reads of a value’s parts than a Result does.

Required Methods§

Source

fn write(&self, w: &mut Writer<'_>)

Source

fn read(r: &mut Reader<'_>) -> Option<Self>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Wire for ()

Source§

fn write(&self, _: &mut Writer<'_>)

Source§

fn read(_: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for Arc<str>

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for Box<str>

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for Duration

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for NonZero<u8>

As the integer, which can’t be zero.

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for NonZero<u16>

As the integer, which can’t be zero.

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for NonZero<u32>

As the integer, which can’t be zero.

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for NonZero<u64>

As the integer, which can’t be zero.

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for NonZero<usize>

As the integer, which can’t be zero.

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for String

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for bool

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for char

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for f32

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for f64

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for i8

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for i16

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for i32

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for i64

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for isize

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for u8

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for u16

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for u32

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for u64

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl Wire for usize

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl<A: Wire, B: Wire, C: Wire, D: Wire> Wire for (A, B, C, D)

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl<A: Wire, B: Wire, C: Wire> Wire for (A, B, C)

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl<A: Wire, B: Wire> Wire for (A, B)

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl<A: Wire> Wire for (A,)

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl<K: Wire + Eq + Hash, V: Wire, S: BuildHasher + Default> Wire for HashMap<K, V, S>

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl<K: Wire + Ord, V: Wire> Wire for BTreeMap<K, V>

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl<T: ?Sized> Wire for PhantomData<T>

Source§

fn write(&self, _: &mut Writer<'_>)

Source§

fn read(_: &mut Reader<'_>) -> Option<Self>

Source§

impl<T: Wire + Default + Copy, const N: usize> Wire for [T; N]

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl<T: Wire + Eq + Hash, S: BuildHasher + Default> Wire for HashSet<T, S>

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl<T: Wire + Ord> Wire for BTreeSet<T>

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl<T: Wire> Wire for Arc<T>

In full: values that cross once and then by key opt in with shared.

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl<T: Wire> Wire for Box<T>

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl<T: Wire> Wire for Box<[T]>

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl<T: Wire> Wire for Option<T>

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Source§

impl<T: Wire> Wire for Vec<T>

Source§

fn write(&self, w: &mut Writer<'_>)

Source§

fn read(r: &mut Reader<'_>) -> Option<Self>

Implementors§