Application

Trait Application 

Source
pub trait Application<E>:
    Clone
    + Send
    + 'static
where E: Rng + Spawner + Metrics + Clock,
{ type SigningScheme: Scheme; type Context: Epochable; type Block: Block; // Required methods fn genesis(&mut self) -> impl Future<Output = Self::Block> + Send; fn propose( &mut self, context: (E, Self::Context), ancestry: AncestorStream<Self::SigningScheme, Self::Block>, ) -> impl Future<Output = Option<Self::Block>> + Send; }
Expand description

Application is a minimal interface for standard implementations that operate over a stream of epoched blocks.

Required Associated Types§

Source

type SigningScheme: Scheme

The signing scheme used by the application.

Source

type Context: Epochable

Context is metadata provided by the consensus engine associated with a given payload.

This often includes things like the proposer, view number, the height, or the epoch.

Source

type Block: Block

The block type produced by the application’s builder.

Required Methods§

Source

fn genesis(&mut self) -> impl Future<Output = Self::Block> + Send

Payload used to initialize the consensus engine in the first epoch.

Source

fn propose( &mut self, context: (E, Self::Context), ancestry: AncestorStream<Self::SigningScheme, Self::Block>, ) -> impl Future<Output = Option<Self::Block>> + Send

Build a new block on top of the provided parent ancestry. If the build job fails, the implementor should return None.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§