Struct frame_system::limits::BlockWeightsBuilder
source · pub struct BlockWeightsBuilder { /* private fields */ }
Expand description
An opinionated builder for Weights
object.
Implementations§
source§impl BlockWeightsBuilder
impl BlockWeightsBuilder
sourcepub fn base_block(self, base_block: Weight) -> Self
pub fn base_block(self, base_block: Weight) -> Self
Set base block weight.
sourcepub fn avg_block_initialization(self, init_cost: Perbill) -> Self
pub fn avg_block_initialization(self, init_cost: Perbill) -> Self
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
always prevents them from being included.
sourcepub fn for_class(
self,
class: impl OneOrMany<DispatchClass>,
action: impl Fn(&mut WeightsPerClass)
) -> Self
pub fn for_class( self, class: impl OneOrMany<DispatchClass>, action: impl Fn(&mut WeightsPerClass) ) -> Self
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.
sourcepub fn build(self) -> ValidationResult
pub fn build(self) -> ValidationResult
Construct the BlockWeights
object.
sourcepub fn build_or_panic(self) -> BlockWeights
pub fn build_or_panic(self) -> BlockWeights
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§
impl RefUnwindSafe for BlockWeightsBuilder
impl Send for BlockWeightsBuilder
impl Sync for BlockWeightsBuilder
impl Unpin for BlockWeightsBuilder
impl UnwindSafe for BlockWeightsBuilder
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
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
.