Trait PassByInner

Source
pub trait PassByInner: Sized {
    type Inner: RIType;

    // Required methods
    fn into_inner(self) -> Self::Inner;
    fn inner(&self) -> &Self::Inner;
    fn from_inner(inner: Self::Inner) -> Self;
}
Expand description

Trait that needs to be implemented by a type that should be passed between wasm and the host, by using the inner type. See Inner for more information.

Required Associated Types§

Source

type Inner: RIType

The inner type that is wrapped by Self.

Required Methods§

Source

fn into_inner(self) -> Self::Inner

Consumes self and returns the inner type.

Source

fn inner(&self) -> &Self::Inner

Returns the reference to the inner type.

Source

fn from_inner(inner: Self::Inner) -> Self

Construct Self from the given inner.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl PassByInner for H160

Source§

type Inner = [u8; 20]

Source§

fn inner(&self) -> &Self::Inner

Source§

fn into_inner(self) -> Self::Inner

Source§

fn from_inner(inner: Self::Inner) -> Self

Source§

impl PassByInner for H256

Source§

type Inner = [u8; 32]

Source§

fn inner(&self) -> &Self::Inner

Source§

fn into_inner(self) -> Self::Inner

Source§

fn from_inner(inner: Self::Inner) -> Self

Source§

impl PassByInner for H512

Source§

type Inner = [u8; 64]

Source§

fn inner(&self) -> &Self::Inner

Source§

fn into_inner(self) -> Self::Inner

Source§

fn from_inner(inner: Self::Inner) -> Self

Implementors§