Trait Application

Source
pub trait Application:
    Clone
    + Send
    + 'static {
    type Context;
    type Digest: Array;

    // Required method
    fn verify(
        &mut self,
        context: Self::Context,
        payload: Self::Digest,
    ) -> impl Future<Output = Receiver<bool>> + Send;
}
Expand description

Application is the interface responsible for processing messages received from the network.

Required Associated Types§

Source

type Context

Context is metadata provided by the broadcast engine to associated with a given payload. This could include things like the public key of the sequencer.

Source

type Digest: Array

Digest is an arbitrary hash digest.

Required Methods§

Source

fn verify( &mut self, context: Self::Context, payload: Self::Digest, ) -> impl Future<Output = Receiver<bool>> + Send

Verify a proposed payload received from the network.

Returns a future that resolves to a boolean indicating success. Part of verification requires ensuring that the data is made available. For example, by storing it in a database.

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§