referrerpolicy=no-referrer-when-downgrade
sp_runtime

Type Alias TryRuntimeError

Source
pub type TryRuntimeError = DispatchError;
Expand description

The error type used as return type in try runtime hooks.

Aliased Type§

enum TryRuntimeError {
Show 15 variants Other(&'static str), CannotLookup, BadOrigin, Module(ModuleError), ConsumerRemaining, NoProviders, TooManyConsumers, Token(TokenError), Arithmetic(ArithmeticError), Transactional(TransactionalError), Exhausted, Corruption, Unavailable, RootNotAllowed, Trie(TrieError),
}

Variants§

§

Other(&'static str)

Some error occurred.

§

CannotLookup

Failed to lookup some data.

§

BadOrigin

A bad origin.

§

Module(ModuleError)

A custom error in a module.

§

ConsumerRemaining

At least one consumer is remaining so the account cannot be destroyed.

§

NoProviders

There are no providers so the account cannot be created.

§

TooManyConsumers

There are too many consumers so the account cannot be created.

§

Token(TokenError)

An error to do with tokens.

§

Arithmetic(ArithmeticError)

An arithmetic error.

§

Transactional(TransactionalError)

The number of transactional layers has been reached, or we are not in a transactional layer.

§

Exhausted

Resources exhausted, e.g. attempt to read/write data which is too large to manipulate.

§

Corruption

The state is corrupt; this is generally not going to fix itself.

§

Unavailable

Some resource (e.g. a preimage) is unavailable right now. This might fix itself later.

§

RootNotAllowed

Root origin is not allowed.

§

Trie(TrieError)

An error with tries.

Implementations

Source§

impl DispatchError

Source

pub fn stripped(self) -> Self

Return the same error but without the attached message.

Trait Implementations

Source§

impl Clone for DispatchError

Source§

fn clone(&self) -> DispatchError

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DispatchError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Decode for DispatchError

Source§

fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>

Attempt to deserialise the value from input.
§

fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self>, ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§

fn skip<I>(input: &mut I) -> Result<(), Error>
where I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
Source§

impl<'de> Deserialize<'de> for DispatchError

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Encode for DispatchError

Source§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
Source§

fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )

Convert self to a slice and append it to the destination.
§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
§

fn using_encoded<R, F>(&self, f: F) -> R
where F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
Source§

impl From<&'static str> for DispatchError

Source§

fn from(err: &'static str) -> DispatchError

Converts to this type from the input type.
Source§

impl From<ArithmeticError> for DispatchError

Source§

fn from(e: ArithmeticError) -> DispatchError

Converts to this type from the input type.
Source§

impl From<BadOrigin> for DispatchError

Source§

fn from(_: BadOrigin) -> Self

Converts to this type from the input type.
Source§

impl From<LookupError> for DispatchError

Source§

fn from(_: LookupError) -> Self

Converts to this type from the input type.
Source§

impl From<TokenError> for DispatchError

Source§

fn from(e: TokenError) -> DispatchError

Converts to this type from the input type.
Source§

impl From<TransactionalError> for DispatchError

Source§

fn from(e: TransactionalError) -> DispatchError

Converts to this type from the input type.
Source§

impl From<TrieError> for DispatchError

Source§

fn from(e: TrieError) -> DispatchError

Converts to this type from the input type.
Source§

impl MaxEncodedLen for DispatchError

Source§

fn max_encoded_len() -> usize

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

impl PartialEq for DispatchError

Source§

fn eq(&self, other: &DispatchError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Printable for DispatchError

Source§

fn print(&self)

Print the object.
Source§

impl Serialize for DispatchError

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TypeInfo for DispatchError

Source§

type Identity = DispatchError

The type identifying for which type info is provided. Read more
Source§

fn type_info() -> Type

Returns the static type identifier for Self.
Source§

impl Copy for DispatchError

Source§

impl DecodeWithMemTracking for DispatchError

Source§

impl EncodeLike for DispatchError

Source§

impl Eq for DispatchError

Source§

impl StructuralPartialEq for DispatchError