Trait oasis_runtime_sdk::modules::rofl::app::App

source ·
pub trait App: Send + Sync + 'static {
    const VERSION: Version;

    // Required methods
    fn id() -> AppId;
    fn consensus_trust_root() -> Option<TrustRoot>;

    // Provided methods
    fn new_transaction<B>(&self, method: &str, body: B) -> Transaction
       where B: Encode { ... }
    fn run<'async_trait>(
        self: Arc<Self>,
        env: Environment<Self>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Sized + 'async_trait { ... }
    fn on_runtime_block<'async_trait>(
        self: Arc<Self>,
        env: Environment<Self>,
        round: u64,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Sized + 'async_trait { ... }
    fn start(self)
       where Self: Sized { ... }
}
Expand description

ROFL component application.

Required Associated Constants§

source

const VERSION: Version

ROFL application version.

Required Methods§

source

fn id() -> AppId

Identifier of the application (used for registrations).

source

fn consensus_trust_root() -> Option<TrustRoot>

Return the consensus layer trust root for this runtime; if None, consensus layer integrity verification will not be performed.

Provided Methods§

source

fn new_transaction<B>(&self, method: &str, body: B) -> Transaction
where B: Encode,

Create a new unsigned transaction.

source

fn run<'async_trait>( self: Arc<Self>, env: Environment<Self>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Main application processing loop.

source

fn on_runtime_block<'async_trait>( self: Arc<Self>, env: Environment<Self>, round: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Logic that runs on each runtime block. Only one of these will run concurrently.

source

fn start(self)
where Self: Sized,

Start the application.

Object Safety§

This trait is not object safe.

Implementors§