Struct frame_system::limits::BlockWeightsBuilder[][src]

pub struct BlockWeightsBuilder { /* fields omitted */ }

An opinionated builder for Weights object.

Implementations

impl BlockWeightsBuilder[src]

pub fn base_block(mut self: Self, base_block: Weight) -> Self[src]

Set base block weight.

pub fn avg_block_initialization(mut self: Self, init_cost: Perbill) -> Self[src]

Average block initialization weight cost.

This value is used to derive maximal allowed extrinsic weight for each class, based on the allowance.

This is to make sure that extrinsics don't stay forever in the pool, because they could seamingly fit the block (since they are below max_block), but the cost of calling on_initialize alway prevents them from being included.

pub fn for_class(
    mut self: Self,
    class: impl OneOrMany<DispatchClass>,
    action: impl Fn(&mut WeightsPerClass)
) -> Self
[src]

Set parameters for particular class.

Note: None values of max_extrinsic will be overwritten in build in case avg_block_initialization rate is set to a non-zero value.

pub fn build(self) -> ValidationResult[src]

Construct the BlockWeights object.

pub fn build_or_panic(self) -> BlockWeights[src]

Construct the BlockWeights object or panic if it's invalid.

This is a convenience method to be called whenever you construct a runtime.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CheckedConversion for T[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IsType<T> for T[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 
[src]

pub fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    T: Bounded,
    S: TryInto<T>, 

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,