Enum frame_support::dispatch::DispatchClass
source · pub enum DispatchClass {
Normal,
Operational,
Mandatory,
}
Expand description
A generalized group of dispatch types.
NOTE whenever upgrading the enum make sure to also update DispatchClass::all and DispatchClass::non_mandatory helper functions.
Variants§
Normal
A normal dispatch.
Operational
An operational dispatch.
Mandatory
A mandatory dispatch. These kinds of dispatch are always included regardless of their weight, therefore it is critical that they are separately validated to ensure that a malicious validator cannot craft a valid but impossibly heavy block. Usually this just means ensuring that the extrinsic can only be included once and that it is always very light.
Do NOT use it for extrinsics that can be heavy.
The only real use case for this is inherent extrinsics that are required to execute in a block for the block to be valid, and it solves the issue in the case that the block initialization is sufficiently heavy to mean that those inherents do not fit into the block. Essentially, we assume that in these exceptional circumstances, it is better to allow an overweight block to be created than to not allow any block at all to be created.
Implementations§
source§impl DispatchClass
impl DispatchClass
sourcepub fn all() -> &'static [DispatchClass]
pub fn all() -> &'static [DispatchClass]
Returns an array containing all dispatch classes.
sourcepub fn non_mandatory() -> &'static [DispatchClass]
pub fn non_mandatory() -> &'static [DispatchClass]
Returns an array of all dispatch classes except Mandatory
.
Trait Implementations§
source§impl Clone for DispatchClass
impl Clone for DispatchClass
source§fn clone(&self) -> DispatchClass
fn clone(&self) -> DispatchClass
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DispatchClass
impl Debug for DispatchClass
source§impl Decode for DispatchClass
impl Decode for DispatchClass
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self> ) -> Result<DecodeFinished, Error>where I: Input,
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where I: Input,
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
source§impl Default for DispatchClass
impl Default for DispatchClass
source§impl<'de> Deserialize<'de> for DispatchClass
impl<'de> Deserialize<'de> for DispatchClass
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl Encode for DispatchClass
impl Encode for DispatchClass
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl<'a> OneOrMany<DispatchClass> for &'a [DispatchClass]
impl<'a> OneOrMany<DispatchClass> for &'a [DispatchClass]
source§impl OneOrMany<DispatchClass> for DispatchClass
impl OneOrMany<DispatchClass> for DispatchClass
source§impl PartialEq<DispatchClass> for DispatchClass
impl PartialEq<DispatchClass> for DispatchClass
source§fn eq(&self, other: &DispatchClass) -> bool
fn eq(&self, other: &DispatchClass) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for DispatchClass
impl Serialize for DispatchClass
source§impl TypeInfo for DispatchClass
impl TypeInfo for DispatchClass
impl Copy for DispatchClass
impl EncodeLike<DispatchClass> for DispatchClass
impl Eq for DispatchClass
impl StructuralEq for DispatchClass
impl StructuralPartialEq for DispatchClass
Auto Trait Implementations§
impl RefUnwindSafe for DispatchClass
impl Send for DispatchClass
impl Sync for DispatchClass
impl Unpin for DispatchClass
impl UnwindSafe for DispatchClass
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Self
and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere T: Decode,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.