pub trait CompactAs: From<Compact<Self>> {
    type As;

    // Required methods
    fn encode_as(&self) -> &Self::As;
    fn decode_from(_: Self::As) -> Result<Self, Error>;
}
Expand description

Allow foreign structs to be wrap in Compact

Required Associated Types§

type As

A compact-encodable type that should be used as the encoding.

Required Methods§

fn encode_as(&self) -> &Self::As

Returns the compact-encodable type.

fn decode_from(_: Self::As) -> Result<Self, Error>

Decode Self from the compact-decoded type.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl CompactAs for OldWeight

§

type As = u64

§

fn encode_as(&self) -> &u64

§

fn decode_from(x: u64) -> Result<OldWeight, Error>

Implementors§

source§

impl CompactAs for HoldConsideration

§

type As = u128

source§

impl CompactAs for Page2

§

type As = u32

source§

impl CompactAs for Page

§

type As = u32

source§

impl CompactAs for PagesAmount

§

type As = u32

source§

impl CompactAs for gclient::metadata::runtime_types::gear_core::percent::Percent

§

type As = u32

source§

impl CompactAs for MemoryInfix

§

type As = u32

source§

impl CompactAs for ReservationNonce

§

type As = u64

source§

impl CompactAs for ExtraFlags

§

type As = u128

source§

impl CompactAs for Vote

§

type As = u8

source§

impl CompactAs for MemberRecord

§

type As = u16

source§

impl CompactAs for gclient::metadata::runtime_types::sp_arithmetic::fixed_point::FixedU128

§

type As = u128

source§

impl CompactAs for gclient::metadata::runtime_types::sp_arithmetic::per_things::PerU16

§

type As = u16

source§

impl CompactAs for gclient::metadata::runtime_types::sp_arithmetic::per_things::Perbill

§

type As = u32

source§

impl CompactAs for gclient::metadata::runtime_types::sp_arithmetic::per_things::Percent

§

type As = u8

source§

impl CompactAs for gclient::metadata::runtime_types::sp_arithmetic::per_things::Permill

§

type As = u32

source§

impl CompactAs for gclient::metadata::runtime_types::sp_arithmetic::per_things::Perquintill

§

type As = u64

source§

impl CompactAs for Slot

§

type As = u64

§

impl CompactAs for FixedI64

§

type As = i64

§

impl CompactAs for FixedI128

§

type As = i128

§

impl CompactAs for FixedU64

§

type As = u64

§

impl CompactAs for gclient::ext::sp_runtime::FixedU128

§

type As = u128

§

impl CompactAs for gclient::ext::sp_runtime::PerU16

Implementation makes any compact encoding of PerThing::Inner valid, when decoding it will saturate up to PerThing::ACCURACY.

§

type As = u16

§

impl CompactAs for gclient::ext::sp_runtime::Perbill

Implementation makes any compact encoding of PerThing::Inner valid, when decoding it will saturate up to PerThing::ACCURACY.

§

type As = u32

§

impl CompactAs for gclient::ext::sp_runtime::Percent

Implementation makes any compact encoding of PerThing::Inner valid, when decoding it will saturate up to PerThing::ACCURACY.

§

type As = u8

§

impl CompactAs for gclient::ext::sp_runtime::Permill

Implementation makes any compact encoding of PerThing::Inner valid, when decoding it will saturate up to PerThing::ACCURACY.

§

type As = u32

§

impl CompactAs for gclient::ext::sp_runtime::Perquintill

Implementation makes any compact encoding of PerThing::Inner valid, when decoding it will saturate up to PerThing::ACCURACY.

§

type As = u64

source§

impl<_0> CompactAs for BitFlags<_0>

§

type As = u64