pub trait Decode {
    fn decode<I>(input: &mut I) -> Result<Self, Error>
    where
        I: Input
; fn skip<I>(input: &mut I) -> Result<(), Error>
    where
        I: Input
, { ... }
fn encoded_fixed_size() -> Option<usize> { ... } }
Expand description

Trait that allows zero-copy read of value-references from slices in LE format.

Required methods

Attempt to deserialise the value from input.

Provided methods

Attempt to skip the encoded value from input.

The default implementation of this function is just calling Decode::decode. When possible, an implementation should provided a specialized implementation.

Returns the fixed encoded size of the type.

If it returns Some(size) then all possible values of this type have the given size (in bytes) when encoded.

NOTE: A type with a fixed encoded size may return None.

Implementations on Foreign Types

source

impl Decode for Entry

Implementors

impl Decode for Event

impl Decode for Call

impl Decode for ForWhat

impl<T, A, B> Decode for AnagolayRecord<T, A, B> where
    T: Decode,
    T: Decode,
    A: Decode,
    A: Decode,
    B: Decode,
    B: Decode

impl<T: AnagolayStructureData, U: AnagolayStructureExtra> Decode for AnagolayStructure<T, U> where
    T: Decode,
    T: Decode,
    Option<U>: Decode,
    Option<U>: Decode

impl<T: ArtifactType> Decode for AnagolayArtifactStructure<T> where
    T: Decode,
    T: Decode

impl<T: Config> Decode for Call<T>

impl<H, N> Decode for State<H, N> where
    Option<(H, N)>: Decode,
    Option<(H, N)>: Decode,
    Option<(H, N)>: Decode,
    Option<(H, N)>: Decode,
    Option<(H, N)>: Decode,
    Option<(H, N)>: Decode

impl<H, N> Decode for Prevote<H, N> where
    H: Decode,
    H: Decode,
    N: Decode,
    N: Decode

impl<H, N> Decode for Precommit<H, N> where
    H: Decode,
    H: Decode,
    N: Decode,
    N: Decode

impl<H, N> Decode for PrimaryPropose<H, N> where
    H: Decode,
    H: Decode,
    N: Decode,
    N: Decode

impl<Id, V, S> Decode for Equivocation<Id, V, S> where
    Id: Decode,
    Id: Decode,
    V: Decode,
    S: Decode,
    (V, S): Decode,
    V: Decode,
    S: Decode,
    (V, S): Decode

impl<H, N> Decode for Message<H, N> where
    Prevote<H, N>: Decode,
    Prevote<H, N>: Decode,
    Precommit<H, N>: Decode,
    Precommit<H, N>: Decode,
    PrimaryPropose<H, N>: Decode,
    PrimaryPropose<H, N>: Decode

impl<H, N, S, Id> Decode for SignedMessage<H, N, S, Id> where
    Message<H, N>: Decode,
    Message<H, N>: Decode,
    S: Decode,
    S: Decode,
    Id: Decode,
    Id: Decode

impl<H, N, S, Id> Decode for Commit<H, N, S, Id> where
    H: Decode,
    H: Decode,
    N: Decode,
    N: Decode,
    Vec<SignedPrecommit<H, N, S, Id>>: Decode,
    Vec<SignedPrecommit<H, N, S, Id>>: Decode

impl<H, N, S, Id> Decode for SignedPrevote<H, N, S, Id> where
    Prevote<H, N>: Decode,
    Prevote<H, N>: Decode,
    S: Decode,
    S: Decode,
    Id: Decode,
    Id: Decode

impl<H, N, S, Id> Decode for SignedPrecommit<H, N, S, Id> where
    Precommit<H, N>: Decode,
    Precommit<H, N>: Decode,
    S: Decode,
    S: Decode,
    Id: Decode,
    Id: Decode

impl<H, N, S, Id> Decode for CompactCommit<H, N, S, Id> where
    H: Decode,
    H: Decode,
    N: Decode,
    N: Decode,
    Vec<Precommit<H, N>>: Decode,
    Vec<Precommit<H, N>>: Decode,
    MultiAuthData<S, Id>: Decode,
    MultiAuthData<S, Id>: Decode

impl<H, N, S, Id> Decode for CatchUp<H, N, S, Id> where
    Vec<SignedPrevote<H, N, S, Id>>: Decode,
    Vec<SignedPrevote<H, N, S, Id>>: Decode,
    Vec<SignedPrecommit<H, N, S, Id>>: Decode,
    Vec<SignedPrecommit<H, N, S, Id>>: Decode,
    H: Decode,
    H: Decode,
    N: Decode,
    N: Decode

impl<H, N, S, Id> Decode for HistoricalVotes<H, N, S, Id> where
    Vec<SignedMessage<H, N, S, Id>>: Decode,
    Vec<SignedMessage<H, N, S, Id>>: Decode

impl<H, N, V> Decode for ForkTree<H, N, V> where
    Vec<Node<H, N, V>>: Decode,
    Vec<Node<H, N, V>>: Decode,
    Option<N>: Decode,
    Option<N>: Decode

impl<B, O> Decode for DecodeDifferent<B, O> where
    B: 'static,
    O: Decode + 'static, 

impl<T: Config + Send + Sync> Decode for CheckGenesis<T> where
    PhantomData<T>: Decode,
    PhantomData<T>: Decode

impl<T: Config + Send + Sync> Decode for CheckMortality<T> where
    PhantomData<T>: Decode,
    PhantomData<T>: Decode

impl<T: Config> Decode for CheckNonce<T> where
    T::Index: HasCompact

impl<T: Config + Send + Sync> Decode for CheckSpecVersion<T> where
    PhantomData<T>: Decode,
    PhantomData<T>: Decode

impl<T: Config + Send + Sync> Decode for CheckTxVersion<T> where
    PhantomData<T>: Decode,
    PhantomData<T>: Decode

impl<T: Config + Send + Sync> Decode for CheckWeight<T> where
    PhantomData<T>: Decode,
    PhantomData<T>: Decode

impl<T: Config> Decode for Event<T> where
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode

impl<T: Config> Decode for Call<T>

impl Decode for Phase

impl<E: Parameter + Member, T> Decode for EventRecord<E, T> where
    E: Decode,
    E: Decode,
    Vec<T>: Decode,
    Vec<T>: Decode

impl<AccountId> Decode for RawOrigin<AccountId> where
    AccountId: Decode,
    AccountId: Decode

impl<Index, AccountData> Decode for AccountInfo<Index, AccountData> where
    Index: Decode,
    Index: Decode,
    AccountData: Decode,
    AccountData: Decode

impl<T: Config> Decode for Event<T> where
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode

impl<T: Config> Decode for Call<T>

impl<T: Config> Decode for Call<T>

impl<T: Config> Decode for Call<T> where
    Vec<T::Header>: Decode,
    Vec<T::Header>: Decode

impl<T: Config<I>, I: 'static> Decode for Event<T, I> where
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::Balance: Decode,
    T::Balance: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::Balance: Decode,
    T::Balance: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::Balance: Decode,
    T::Balance: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::Balance: Decode,
    T::Balance: Decode,
    T::Balance: Decode,
    T::Balance: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::Balance: Decode,
    T::Balance: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::Balance: Decode,
    T::Balance: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::Balance: Decode,
    T::Balance: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::Balance: Decode,
    T::Balance: Decode

impl<T: Config<I>, I: 'static> Decode for Call<T, I> where
    <T::Lookup as StaticLookup>::Source: Decode,
    <T::Lookup as StaticLookup>::Source: Decode,
    <T::Lookup as StaticLookup>::Source: Decode,
    <T::Lookup as StaticLookup>::Source: Decode,
    <T::Lookup as StaticLookup>::Source: Decode,
    <T::Lookup as StaticLookup>::Source: Decode,
    <T::Lookup as StaticLookup>::Source: Decode,
    <T::Lookup as StaticLookup>::Source: Decode,
    <T::Lookup as StaticLookup>::Source: Decode,
    <T::Lookup as StaticLookup>::Source: Decode,
    T::Balance: HasCompact,
    T::Balance: HasCompact,
    T::Balance: HasCompact,
    T::Balance: HasCompact,
    T::Balance: HasCompact

impl Decode for Reasons

impl<Balance> Decode for BalanceLock<Balance> where
    Balance: Decode,
    Balance: Decode

impl<Balance> Decode for AccountData<Balance> where
    Balance: Decode,
    Balance: Decode,
    Balance: Decode,
    Balance: Decode,
    Balance: Decode,
    Balance: Decode,
    Balance: Decode,
    Balance: Decode

impl<N> Decode for OldStoredPendingChange<N> where
    N: Decode,
    N: Decode,
    N: Decode,
    N: Decode

impl<N> Decode for StoredState<N> where
    N: Decode,
    N: Decode,
    N: Decode,
    N: Decode,
    N: Decode,
    N: Decode,
    N: Decode,
    N: Decode

impl Decode for Event

impl<T: Config> Decode for Call<T> where
    EquivocationProof<T::Hash, T::BlockNumber>: Decode,
    EquivocationProof<T::Hash, T::BlockNumber>: Decode,
    T::KeyOwnerProof: Decode,
    T::KeyOwnerProof: Decode,
    EquivocationProof<T::Hash, T::BlockNumber>: Decode,
    EquivocationProof<T::Hash, T::BlockNumber>: Decode,
    T::KeyOwnerProof: Decode,
    T::KeyOwnerProof: Decode,
    T::BlockNumber: Decode,
    T::BlockNumber: Decode,
    T::BlockNumber: Decode,
    T::BlockNumber: Decode

impl<T: Config> Decode for Call<T>

impl Decode for Event

impl<T: Config> Decode for Call<T> where
    T::Keys: Decode,
    T::Keys: Decode

impl<T: Config> Decode for Call<T> where
    Box<<T as Config>::Call>: Decode,
    Box<<T as Config>::Call>: Decode,
    Box<<T as Config>::Call>: Decode,
    Box<<T as Config>::Call>: Decode,
    <T::Lookup as StaticLookup>::Source: Decode,
    <T::Lookup as StaticLookup>::Source: Decode,
    <T::Lookup as StaticLookup>::Source: Decode,
    <T::Lookup as StaticLookup>::Source: Decode,
    Box<<T as Config>::Call>: Decode,
    Box<<T as Config>::Call>: Decode

impl<AccountId> Decode for RawEvent<AccountId> where
    AccountId: Decode,
    AccountId: Decode

impl<T: Config> Decode for Call<T> where
    T::Moment: HasCompact

impl<Balance> Decode for InclusionFee<Balance> where
    Balance: Decode,
    Balance: Decode,
    Balance: Decode,
    Balance: Decode,
    Balance: Decode,
    Balance: Decode

impl<Balance> Decode for FeeDetails<Balance> where
    Option<InclusionFee<Balance>>: Decode,
    Option<InclusionFee<Balance>>: Decode,
    Balance: Decode,
    Balance: Decode

impl<Balance> Decode for RuntimeDispatchInfo<Balance> where
    Balance: Decode,
    Balance: Decode

impl<T: Config> Decode for Call<T>

impl Decode for Event

impl<T: Config> Decode for Call<T> where
    Vec<<T as Config>::Call>: Decode,
    Vec<<T as Config>::Call>: Decode,
    Box<<T as Config>::Call>: Decode,
    Box<<T as Config>::Call>: Decode,
    Vec<<T as Config>::Call>: Decode,
    Vec<<T as Config>::Call>: Decode

impl Decode for U128

impl Decode for U256

impl Decode for U512

impl Decode for H128

impl Decode for H160

impl Decode for H256

impl Decode for H512

impl Decode for Epoch

impl<Hash, Number, E: Epoch> Decode for EpochChangesV0<Hash, Number, E> where
    ForkTree<Hash, Number, PersistedEpoch<E>>: Decode,
    ForkTree<Hash, Number, PersistedEpoch<E>>: Decode

impl<E: Epoch> Decode for EpochHeader<E> where
    E::Slot: Decode,
    E::Slot: Decode,
    E::Slot: Decode,
    E::Slot: Decode

impl<E: Epoch> Decode for PersistedEpoch<E> where
    E: Decode,
    E: Decode,
    E: Decode,
    E: Decode,
    E: Decode,
    E: Decode

impl<E: Epoch> Decode for PersistedEpochHeader<E> where
    EpochHeader<E>: Decode,
    EpochHeader<E>: Decode,
    EpochHeader<E>: Decode,
    EpochHeader<E>: Decode,
    EpochHeader<E>: Decode,
    EpochHeader<E>: Decode

impl<Hash, Number, E: Epoch> Decode for EpochChanges<Hash, Number, E> where
    ForkTree<Hash, Number, PersistedEpochHeader<E>>: Decode,
    ForkTree<Hash, Number, PersistedEpochHeader<E>>: Decode,
    BTreeMap<(Hash, Number), PersistedEpoch<E>>: Decode,
    BTreeMap<(Hash, Number), PersistedEpoch<E>>: Decode

impl<T> Decode for SlotDuration<T> where
    T: Decode,
    T: Decode

impl<H, N> Decode for AuthoritySet<H, N> where
    ForkTree<H, N, PendingChange<H, N>>: Decode,
    ForkTree<H, N, PendingChange<H, N>>: Decode,
    Vec<PendingChange<H, N>>: Decode,
    Vec<PendingChange<H, N>>: Decode,
    AuthoritySetChanges<N>: Decode,
    AuthoritySetChanges<N>: Decode

impl<Header: HeaderT> Decode for FinalityProof<Header> where
    Header::Hash: Decode,
    Header::Hash: Decode,
    Vec<Header>: Decode,
    Vec<Header>: Decode

impl<Block: BlockT> Decode for GrandpaJustification<Block> where
    Commit<Block>: Decode,
    Commit<Block>: Decode,
    Vec<Block::Header>: Decode,
    Vec<Block::Header>: Decode

impl Decode for Public

impl Decode for Signature

impl Decode for Public

impl Decode for Signature

impl Decode for Public

impl Decode for Signature

impl Decode for Percent

impl Decode for PerU16

impl Decode for Permill

impl Decode for Perbill

impl Decode for FixedI64

impl Decode for FixedI128

impl Decode for FixedU128

impl<AuthorityId: Codec> Decode for ConsensusLog<AuthorityId> where
    Vec<AuthorityId>: Decode,
    Vec<AuthorityId>: Decode

impl Decode for PreDigest

impl Decode for Epoch

impl Decode for Slot

impl<Header, Id> Decode for EquivocationProof<Header, Id> where
    Id: Decode,
    Id: Decode,
    Header: Decode,
    Header: Decode,
    Header: Decode,
    Header: Decode

impl Decode for VRFOutput

impl Decode for VRFProof

impl Decode for KeyTypeId

impl Decode for Public

impl Decode for Signature

impl Decode for Public

impl Decode for Signature

impl Decode for Public

impl Decode for Signature

impl Decode for HttpError

impl Decode for Timestamp

impl Decode for Duration

impl Decode for HostError

impl Decode for Entry

impl Decode for LogLevel

impl Decode for Void

impl<N> Decode for ScheduledChange<N> where
    N: Decode,
    N: Decode

impl<N: Codec> Decode for ConsensusLog<N> where
    ScheduledChange<N>: Decode,
    ScheduledChange<N>: Decode,
    N: Decode,
    N: Decode,
    ScheduledChange<N>: Decode,
    ScheduledChange<N>: Decode,
    N: Decode,
    N: Decode,
    N: Decode,
    N: Decode

impl<H, N> Decode for EquivocationProof<H, N> where
    Equivocation<H, N>: Decode,
    Equivocation<H, N>: Decode

impl Decode for Error

impl<T: Encode + Decode> Decode for Crossing<T> where
    T: Decode,
    T: Decode

impl<Address, Call, Signature, Extra> Decode for UncheckedExtrinsic<Address, Call, Signature, Extra> where
    Address: Decode,
    Signature: Decode,
    Call: Decode,
    Extra: SignedExtension

impl Decode for Era

impl<Number, Hash> Decode for Header<Number, Hash> where
    Number: HasCompact + Copy + Into<U256> + TryFrom<U256>,
    Hash: HashT,
    Hash::Output: Decode

impl<Header, Extrinsic: MaybeSerialize> Decode for Block<Header, Extrinsic> where
    Header: Decode,
    Header: Decode,
    Vec<Extrinsic>: Decode,
    Vec<Extrinsic>: Decode

impl<Block> Decode for SignedBlock<Block> where
    Block: Decode,
    Block: Decode

impl<Hash> Decode for Digest<Hash> where
    Vec<DigestItem<Hash>>: Decode,
    Vec<DigestItem<Hash>>: Decode

impl<Hash: Decode> Decode for DigestItem<Hash>

impl Decode for Time

impl<Xt> Decode for ExtrinsicWrapper<Xt> where
    Xt: Decode,
    Xt: Decode

impl<Xt> Decode for Block<Xt> where
    Vec<Xt>: Decode,
    Vec<Xt>: Decode

impl<Call, Extra> Decode for TestXt<Call, Extra> where
    Option<(u64, Extra)>: Decode,
    Option<(u64, Extra)>: Decode,
    Call: Decode,
    Call: Decode

impl Decode for BadOrigin

impl<Hashing: Hash> Decode for RandomNumberGenerator<Hashing> where
    Hashing::Output: Decode,
    Hashing::Output: Decode

impl<AccountId, AccountIndex> Decode for MultiAddress<AccountId, AccountIndex> where
    AccountId: Decode,
    AccountId: Decode,
    AccountIndex: HasCompact

impl Decode for ModuleId

impl<Info> Decode for DispatchErrorWithPostInfo<Info> where
    Info: Eq + PartialEq + Clone + Copy + Encode + Decode + Printable,
    Info: Decode,
    Info: Decode

impl<Reporter, Offender> Decode for OffenceDetails<Reporter, Offender> where
    Offender: Decode,
    Offender: Decode,
    Vec<Reporter>: Decode,
    Vec<Reporter>: Decode

impl Decode for WasmLevel

impl Decode for WasmValue

impl Decode for Value

impl<T: Config> Decode for Event<T> where
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode

impl<T: Config> Decode for Call<T>