Module sp_runtime_interface::pass_by[][src]

Provides the PassBy trait to simplify the implementation of the runtime interface traits for custom types.

Codec, Inner and Enum are the provided strategy implementations.

Structs

Codec

The implementation of the pass by codec strategy. This strategy uses a SCALE encoded representation of the type between wasm and the host.

Enum

The implementation of the pass by enum strategy. This strategy uses an u8 internally to pass the enum between wasm and the host. So, this strategy only supports enums with unit variants.

Inner

The implementation of the pass by inner type strategy. The type that uses this strategy will be passed between wasm and the host by using the wrapped inner type. So, this strategy is only usable by newtype structs.

Traits

PassBy

Something that should be passed between wasm and the host using the given strategy.

PassByImpl

Something that provides a strategy for passing a type between wasm and the host.

PassByInner

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.

Derive Macros

PassByCodec

Derive macro for implementing PassBy with the Codec strategy.

PassByEnum

Derive macro for implementing PassBy with the Enum strategy.

PassByInner

Derive macro for implementing PassBy with the Inner strategy.