Skip to main content

Context

Struct Context 

Source
pub struct Context<Codec>
where Codec: Codec,
{ pub codec: Codec, pub buffer: Vec<u8>, }
Expand description

Context needed to prepare for transfer/reconstruct Wrapper.

Fields§

§codec: Codec

Codec used to serialize/deserialize message.

§buffer: Vec<u8>

Work buffer.

Implementations§

Source§

impl<Codec> Context<Codec>
where Codec: Codec,

Source

pub fn new(codec: Codec) -> Self

Create new context using provided codec.

Trait Implementations§

Source§

impl<Codec> Debug for Context<Codec>
where Codec: Codec + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C> FromTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Int8Array
where C: Codec,

Source§

type Input = Wrapper<C, Int8Array>

Type of input (Transferable) data.
Source§

fn from_transferable(input: Self::Input) -> Self

Reconstruct from Transferable data.
Source§

impl<C> FromTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Uint8Array
where C: Codec,

Source§

type Input = Wrapper<C, Uint8Array>

Type of input (Transferable) data.
Source§

fn from_transferable(input: Self::Input) -> Self

Reconstruct from Transferable data.
Source§

impl<C> FromTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Int16Array
where C: Codec,

Source§

type Input = Wrapper<C, Int16Array>

Type of input (Transferable) data.
Source§

fn from_transferable(input: Self::Input) -> Self

Reconstruct from Transferable data.
Source§

impl<C> FromTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Uint16Array
where C: Codec,

Source§

type Input = Wrapper<C, Uint16Array>

Type of input (Transferable) data.
Source§

fn from_transferable(input: Self::Input) -> Self

Reconstruct from Transferable data.
Source§

impl<C> FromTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Int32Array
where C: Codec,

Source§

type Input = Wrapper<C, Int32Array>

Type of input (Transferable) data.
Source§

fn from_transferable(input: Self::Input) -> Self

Reconstruct from Transferable data.
Source§

impl<C> FromTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Uint32Array
where C: Codec,

Source§

type Input = Wrapper<C, Uint32Array>

Type of input (Transferable) data.
Source§

fn from_transferable(input: Self::Input) -> Self

Reconstruct from Transferable data.
Source§

impl<C> FromTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Float16Array
where C: Codec,

Source§

type Input = Wrapper<C, Float16Array>

Type of input (Transferable) data.
Source§

fn from_transferable(input: Self::Input) -> Self

Reconstruct from Transferable data.
Source§

impl<C> FromTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Float32Array
where C: Codec,

Source§

type Input = Wrapper<C, Float32Array>

Type of input (Transferable) data.
Source§

fn from_transferable(input: Self::Input) -> Self

Reconstruct from Transferable data.
Source§

impl<C> FromTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Float64Array
where C: Codec,

Source§

type Input = Wrapper<C, Float64Array>

Type of input (Transferable) data.
Source§

fn from_transferable(input: Self::Input) -> Self

Reconstruct from Transferable data.
Source§

impl<C> FromTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for BigInt64Array
where C: Codec,

Source§

type Input = Wrapper<C, BigInt64Array>

Type of input (Transferable) data.
Source§

fn from_transferable(input: Self::Input) -> Self

Reconstruct from Transferable data.
Source§

impl<C> FromTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for BigUint64Array
where C: Codec,

Source§

type Input = Wrapper<C, BigUint64Array>

Type of input (Transferable) data.
Source§

fn from_transferable(input: Self::Input) -> Self

Reconstruct from Transferable data.
Source§

impl<Codec, T> FromTransferable<Context<Codec>, Error<<Codec as Encode>::Error, <Codec as Decode>::Error>> for Wrapper<Codec, T>
where Codec: Codec, for<'de> T: Serialize + Deserialize<'de>,

Source§

type Input = Wrapper<Codec, T>

Type of input (Transferable) data.
Source§

fn from_transferable(input: Self::Input) -> Self

Reconstruct from Transferable data.
Source§

impl<C> IntoTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Int8Array
where C: Codec,

Source§

type Output = Wrapper<C, Int8Array>

Type of output (Transferable) data.
Source§

fn into_transferable(self) -> Self::Output

Convert into Transferable data.
Source§

impl<C> IntoTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Uint8Array
where C: Codec,

Source§

type Output = Wrapper<C, Uint8Array>

Type of output (Transferable) data.
Source§

fn into_transferable(self) -> Self::Output

Convert into Transferable data.
Source§

impl<C> IntoTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Int16Array
where C: Codec,

Source§

type Output = Wrapper<C, Int16Array>

Type of output (Transferable) data.
Source§

fn into_transferable(self) -> Self::Output

Convert into Transferable data.
Source§

impl<C> IntoTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Uint16Array
where C: Codec,

Source§

type Output = Wrapper<C, Uint16Array>

Type of output (Transferable) data.
Source§

fn into_transferable(self) -> Self::Output

Convert into Transferable data.
Source§

impl<C> IntoTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Int32Array
where C: Codec,

Source§

type Output = Wrapper<C, Int32Array>

Type of output (Transferable) data.
Source§

fn into_transferable(self) -> Self::Output

Convert into Transferable data.
Source§

impl<C> IntoTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Uint32Array
where C: Codec,

Source§

type Output = Wrapper<C, Uint32Array>

Type of output (Transferable) data.
Source§

fn into_transferable(self) -> Self::Output

Convert into Transferable data.
Source§

impl<C> IntoTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Float16Array
where C: Codec,

Source§

type Output = Wrapper<C, Float16Array>

Type of output (Transferable) data.
Source§

fn into_transferable(self) -> Self::Output

Convert into Transferable data.
Source§

impl<C> IntoTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Float32Array
where C: Codec,

Source§

type Output = Wrapper<C, Float32Array>

Type of output (Transferable) data.
Source§

fn into_transferable(self) -> Self::Output

Convert into Transferable data.
Source§

impl<C> IntoTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for Float64Array
where C: Codec,

Source§

type Output = Wrapper<C, Float64Array>

Type of output (Transferable) data.
Source§

fn into_transferable(self) -> Self::Output

Convert into Transferable data.
Source§

impl<C> IntoTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for BigInt64Array
where C: Codec,

Source§

type Output = Wrapper<C, BigInt64Array>

Type of output (Transferable) data.
Source§

fn into_transferable(self) -> Self::Output

Convert into Transferable data.
Source§

impl<C> IntoTransferable<Context<C>, Error<<C as Encode>::Error, <C as Decode>::Error>> for BigUint64Array
where C: Codec,

Source§

type Output = Wrapper<C, BigUint64Array>

Type of output (Transferable) data.
Source§

fn into_transferable(self) -> Self::Output

Convert into Transferable data.
Source§

impl<Codec, T> IntoTransferable<Context<Codec>, Error<<Codec as Encode>::Error, <Codec as Decode>::Error>> for Wrapper<Codec, T>
where Codec: Codec, for<'de> T: Serialize + Deserialize<'de>,

Source§

type Output = Wrapper<Codec, T>

Type of output (Transferable) data.
Source§

fn into_transferable(self) -> Self::Output

Convert into Transferable data.

Auto Trait Implementations§

§

impl<Codec> Freeze for Context<Codec>
where Codec: Freeze,

§

impl<Codec> RefUnwindSafe for Context<Codec>
where Codec: RefUnwindSafe,

§

impl<Codec> Send for Context<Codec>
where Codec: Send,

§

impl<Codec> Sync for Context<Codec>
where Codec: Sync,

§

impl<Codec> Unpin for Context<Codec>
where Codec: Unpin,

§

impl<Codec> UnsafeUnpin for Context<Codec>
where Codec: UnsafeUnpin,

§

impl<Codec> UnwindSafe for Context<Codec>
where Codec: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ConditionalSend for T

Source§

impl<T> Error for T
where T: ConditionalSend + 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more