referrerpolicy=no-referrer-when-downgrade

Trait SlotWorker

Source
pub trait SlotWorker<B: BlockT> {
    // Required method
    fn on_slot<'life0, 'async_trait>(
        &'life0 mut self,
        slot_info: SlotInfo<B>,
    ) -> Pin<Box<dyn Future<Output = Option<B>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: '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§

Source

fn on_slot<'life0, 'async_trait>( &'life0 mut self, slot_info: SlotInfo<B>, ) -> Pin<Box<dyn Future<Output = Option<B>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a new slot is triggered.

Returns a future that resolves to a block.

If block production failed, None is returned.

Implementors§