Trait sc_consensus_slots::SlotWorker[][src]

pub trait SlotWorker<B: BlockT, Proof> {
    fn on_slot<'life0, 'async_trait>(
        &'life0 mut self,
        slot_info: SlotInfo<B>
    ) -> Pin<Box<dyn Future<Output = Option<SlotResult<B, Proof>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }
Expand description

A worker that should be invoked at every new slot.

The implementation should not make any assumptions of the slot being bound to the time or similar. The only valid assumption is that the slot number is always increasing.

Required methods

Called when a new slot is triggered.

Returns a future that resolves to a SlotResult iff a block was successfully built in the slot. Otherwise None is returned.

Implementors