Struct sc_basic_authorship::ProposerFactory [−][src]
pub struct ProposerFactory<A, B, C, PR> { /* fields omitted */ }
Expand description
Proposer
factory.
Implementations
pub fn new(
spawn_handle: impl SpawnNamed + 'static,
client: Arc<C>,
transaction_pool: Arc<A>,
prometheus: Option<&PrometheusRegistry>,
telemetry: Option<TelemetryHandle>
) -> Self
pub fn new(
spawn_handle: impl SpawnNamed + 'static,
client: Arc<C>,
transaction_pool: Arc<A>,
prometheus: Option<&PrometheusRegistry>,
telemetry: Option<TelemetryHandle>
) -> Self
Create a new proposer factory.
Proof recording will be disabled when using proposers built by this instance to build blocks.
pub fn with_proof_recording(
spawn_handle: impl SpawnNamed + 'static,
client: Arc<C>,
transaction_pool: Arc<A>,
prometheus: Option<&PrometheusRegistry>,
telemetry: Option<TelemetryHandle>
) -> Self
pub fn with_proof_recording(
spawn_handle: impl SpawnNamed + 'static,
client: Arc<C>,
transaction_pool: Arc<A>,
prometheus: Option<&PrometheusRegistry>,
telemetry: Option<TelemetryHandle>
) -> Self
Create a new proposer factory with proof recording enabled.
Each proposer created by this instance will record a proof while building a block.
This will also include the proof into the estimation of the block size. This can be disabled
by calling ProposerFactory::disable_proof_in_block_size_estimation
.
Disable the proof inclusion when estimating the block size.
Set the default block size limit in bytes.
The default value for the block size limit is:
DEFAULT_BLOCK_SIZE_LIMIT
.
If there is no block size limit passed to sp_consensus::Proposer::propose
, this value will be used.
Trait Implementations
impl<A, B, Block, C, PR> Environment<Block> for ProposerFactory<A, B, C, PR> where
A: TransactionPool<Block = Block> + 'static,
B: Backend<Block> + Send + Sync + 'static,
Block: BlockT,
C: BlockBuilderProvider<B, Block, C> + HeaderBackend<Block> + ProvideRuntimeApi<Block> + Send + Sync + 'static,
C::Api: ApiExt<Block, StateBackend = StateBackendFor<B, Block>> + BlockBuilderApi<Block>,
PR: ProofRecording,
impl<A, B, Block, C, PR> Environment<Block> for ProposerFactory<A, B, C, PR> where
A: TransactionPool<Block = Block> + 'static,
B: Backend<Block> + Send + Sync + 'static,
Block: BlockT,
C: BlockBuilderProvider<B, Block, C> + HeaderBackend<Block> + ProvideRuntimeApi<Block> + Send + Sync + 'static,
C::Api: ApiExt<Block, StateBackend = StateBackendFor<B, Block>> + BlockBuilderApi<Block>,
PR: ProofRecording,
type CreateProposer = Ready<Result<Self::Proposer, Self::Error>>
type CreateProposer = Ready<Result<Self::Proposer, Self::Error>>
A future that resolves to the proposer.
Auto Trait Implementations
impl<A, B, C, PR> !RefUnwindSafe for ProposerFactory<A, B, C, PR>
impl<A, B, C, PR> Send for ProposerFactory<A, B, C, PR> where
A: Send + Sync,
B: Send,
C: Send + Sync,
PR: Send,
impl<A, B, C, PR> Sync for ProposerFactory<A, B, C, PR> where
A: Send + Sync,
B: Sync,
C: Send + Sync,
PR: Sync,
impl<A, B, C, PR> Unpin for ProposerFactory<A, B, C, PR> where
B: Unpin,
PR: Unpin,
impl<A, B, C, PR> !UnwindSafe for ProposerFactory<A, B, C, PR>
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more