pub trait MaxEncodedLen: Encode {
    fn max_encoded_len() -> usize;
}
Expand description

Items implementing MaxEncodedLen have a statically known maximum encoded size.

Some containers, such as BoundedVec, have enforced size limits and this trait can be implemented accurately. Other containers, such as StorageMap, do not have enforced size limits. For those containers, it is necessary to make a documented assumption about the maximum usage, and compute the max encoded length based on that assumption.

Required Methods§

Upper bound, in bytes, of the maximum encoded size of this item.

Implementations on Foreign Types§

Implementors§

impl<MerkleRoot> MaxEncodedLen for BeefyAuthoritySet<MerkleRoot>where
    MerkleRoot: MaxEncodedLen,

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

impl<Balance, BlockNumber, Price> MaxEncodedLen for AggregatedEntry<Balance, BlockNumber, Price>where
    Price: MaxEncodedLen,
    Volume<Balance>: MaxEncodedLen,
    Liquidity<Balance>: MaxEncodedLen,
    BlockNumber: MaxEncodedLen,

impl<Balance> MaxEncodedLen for Volume<Balance>where
    Balance: MaxEncodedLen,

impl<Balance> MaxEncodedLen for Liquidity<Balance>where
    Balance: MaxEncodedLen,

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

impl<ReserveIdentifier, Balance> MaxEncodedLen for ReserveData<ReserveIdentifier, Balance>where
    ReserveIdentifier: MaxEncodedLen,
    Balance: MaxEncodedLen,

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

impl<AccountId, Balance, BlockNumber> MaxEncodedLen for AuctionInfo<AccountId, Balance, BlockNumber>where
    Option<(AccountId, Balance)>: MaxEncodedLen,
    BlockNumber: MaxEncodedLen,
    Option<BlockNumber>: MaxEncodedLen,

impl<BlockNumber, Balance> MaxEncodedLen for VestingSchedule<BlockNumber, Balance>where
    BlockNumber: MaxEncodedLen,
    Balance: HasCompact + MaxEncodedLen + HasCompact,

impl<T: Config<I>, I: 'static> MaxEncodedLen for Bag<T, I>

impl<T: Config<I>, I: 'static> MaxEncodedLen for Node<T, I>

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

impl<ReserveIdentifier, Balance> MaxEncodedLen for ReserveData<ReserveIdentifier, Balance>where
    ReserveIdentifier: MaxEncodedLen,
    Balance: MaxEncodedLen,

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

impl<AccountId, Balance, BlockNumber> MaxEncodedLen for Bounty<AccountId, Balance, BlockNumber>where
    AccountId: MaxEncodedLen,
    Balance: MaxEncodedLen,
    BountyStatus<AccountId, BlockNumber>: MaxEncodedLen,

impl<AccountId, BlockNumber> MaxEncodedLen for BountyStatus<AccountId, BlockNumber>where
    AccountId: MaxEncodedLen,
    BlockNumber: MaxEncodedLen,

impl<AccountId, Balance, BlockNumber> MaxEncodedLen for ChildBounty<AccountId, Balance, BlockNumber>where
    Balance: MaxEncodedLen,
    ChildBountyStatus<AccountId, BlockNumber>: MaxEncodedLen,

impl<AccountId, BlockNumber> MaxEncodedLen for ChildBountyStatus<AccountId, BlockNumber>where
    AccountId: MaxEncodedLen,
    BlockNumber: MaxEncodedLen,

impl<AccountId, Balance> MaxEncodedLen for CandidateInfo<AccountId, Balance>where
    AccountId: MaxEncodedLen,
    Balance: MaxEncodedLen,

impl<AccountId, I> MaxEncodedLen for RawOrigin<AccountId, I>where
    AccountId: MaxEncodedLen,

impl<BlockNumber> MaxEncodedLen for OracleEntry<BlockNumber>where
    BlockNumber: MaxEncodedLen,

impl<Balance, AccountId> MaxEncodedLen for GiltBid<Balance, AccountId>where
    Balance: MaxEncodedLen,
    AccountId: MaxEncodedLen,

impl<Balance, AccountId, BlockNumber> MaxEncodedLen for ActiveGilt<Balance, AccountId, BlockNumber>where
    Balance: MaxEncodedLen,
    AccountId: MaxEncodedLen,
    BlockNumber: MaxEncodedLen,

impl<Balance> MaxEncodedLen for ActiveGiltsTotal<Balance>where
    Balance: MaxEncodedLen,

impl<N, Limit> MaxEncodedLen for StoredPendingChange<N, Limit>where
    N: MaxEncodedLen,
    Limit: Get<u32>,

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

impl<Balance> MaxEncodedLen for Judgement<Balance>where
    Balance: MaxEncodedLen + Encode + Decode + MaxEncodedLen + Copy + Clone + Debug + Eq + PartialEq,

impl<FieldLimit: Get<u32>> MaxEncodedLen for IdentityInfo<FieldLimit>

impl<Balance: Encode + Decode + MaxEncodedLen + Copy + Clone + Debug + Eq + PartialEq, MaxJudgements: Get<u32>, MaxAdditionalFields: Get<u32>> MaxEncodedLen for Registration<Balance, MaxJudgements, MaxAdditionalFields>

impl<Balance, AccountId> MaxEncodedLen for RegistrarInfo<Balance, AccountId>where
    AccountId: MaxEncodedLen + Encode + Decode + Clone + Debug + Eq + PartialEq,
    Balance: MaxEncodedLen + Encode + Decode + Clone + Debug + Eq + PartialEq,

impl<PeerIdEncodingLimit, MultiAddrEncodingLimit, AddressesLimit> MaxEncodedLen for BoundedOpaqueNetworkState<PeerIdEncodingLimit, MultiAddrEncodingLimit, AddressesLimit>where
    PeerIdEncodingLimit: Get<u32>,
    MultiAddrEncodingLimit: Get<u32>,
    AddressesLimit: Get<u32>,

impl<T: Config<I>, I: 'static> MaxEncodedLen for GlobalFarmData<T, I>

impl<T: Config<I>, I: 'static> MaxEncodedLen for YieldFarmData<T, I>

impl<T: Config<I>, I: 'static> MaxEncodedLen for DepositData<T, I>

impl<T: Config<I>, I: 'static> MaxEncodedLen for YieldFarmEntry<T, I>

impl<CollectionType, BoundedVec> MaxEncodedLen for CollectionInfo<CollectionType, BoundedVec>where
    CollectionType: MaxEncodedLen,
    BoundedVec: MaxEncodedLen,

impl<BoundedVec> MaxEncodedLen for ItemInfo<BoundedVec>where
    BoundedVec: MaxEncodedLen,

impl<T> MaxEncodedLen for ConfigOp<T>where
    T: MaxEncodedLen + Codec + Debug,

impl<T> MaxEncodedLen for PoolMember<T>where
    T: Config,

impl<AccountId> MaxEncodedLen for PoolRoles<AccountId>where
    AccountId: MaxEncodedLen,
    Option<AccountId>: MaxEncodedLen,

impl<T> MaxEncodedLen for BondedPoolInner<T>where
    T: Config,

impl<T> MaxEncodedLen for RewardPool<T>where
    T: Config,

impl<T> MaxEncodedLen for UnbondPool<T>where
    T: Config,

impl<T> MaxEncodedLen for SubPools<T>where
    T: Config,

impl<AccountId, Balance> MaxEncodedLen for RequestStatus<AccountId, Balance>where
    Option<(AccountId, Balance)>: MaxEncodedLen,

impl<AccountId, ProxyType, BlockNumber> MaxEncodedLen for ProxyDefinition<AccountId, ProxyType, BlockNumber>where
    AccountId: MaxEncodedLen,
    ProxyType: MaxEncodedLen,
    BlockNumber: MaxEncodedLen,

impl<AccountId, Hash, BlockNumber> MaxEncodedLen for Announcement<AccountId, Hash, BlockNumber>where
    AccountId: MaxEncodedLen,
    Hash: MaxEncodedLen,
    BlockNumber: MaxEncodedLen,

impl<BlockNumber, Balance, Friends> MaxEncodedLen for ActiveRecovery<BlockNumber, Balance, Friends>where
    BlockNumber: MaxEncodedLen,
    Balance: MaxEncodedLen,
    Friends: MaxEncodedLen,

impl<BlockNumber, Balance, Friends> MaxEncodedLen for RecoveryConfig<BlockNumber, Balance, Friends>where
    BlockNumber: MaxEncodedLen,
    Balance: MaxEncodedLen,
    Friends: MaxEncodedLen,

impl<AccountId, Balance> MaxEncodedLen for Proposal<AccountId, Balance>where
    AccountId: MaxEncodedLen,
    Balance: MaxEncodedLen,

impl<AccountId, DepositBalance> MaxEncodedLen for CollectionDetails<AccountId, DepositBalance>where
    AccountId: MaxEncodedLen,
    DepositBalance: MaxEncodedLen,

impl<AccountId, DepositBalance> MaxEncodedLen for ItemDetails<AccountId, DepositBalance>where
    AccountId: MaxEncodedLen,
    Option<AccountId>: MaxEncodedLen,
    DepositBalance: MaxEncodedLen,

impl<DepositBalance, StringLimit: Get<u32>> MaxEncodedLen for CollectionMetadata<DepositBalance, StringLimit>where
    DepositBalance: MaxEncodedLen,

impl<DepositBalance, StringLimit: Get<u32>> MaxEncodedLen for ItemMetadata<DepositBalance, StringLimit>where
    DepositBalance: MaxEncodedLen,

impl<Balance, BlockNumber> MaxEncodedLen for VestingInfo<Balance, BlockNumber>where
    Balance: MaxEncodedLen,
    BlockNumber: MaxEncodedLen,

impl MaxEncodedLen for Id

impl<AccountId, LeasePeriod> MaxEncodedLen for ParachainTemporarySlot<AccountId, LeasePeriod>where
    AccountId: MaxEncodedLen,
    LeasePeriod: MaxEncodedLen,
    Option<LeasePeriod>: MaxEncodedLen,