pub trait App:
Send
+ Sync
+ 'static {
const VERSION: Version;
// Provided methods
fn id() -> AppId { ... }
fn consensus_trust_root() -> Option<TrustRoot> { ... }
fn new_transaction<B>(&self, method: &str, body: B) -> Transaction
where B: Encode { ... }
fn init(&mut self, host: Arc<Protocol>) { ... }
fn get_metadata<'async_trait>(
self: Arc<Self>,
env: Environment<Self>,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<String, String>>> + Send + 'async_trait>>
where Self: Sized + 'async_trait { ... }
fn post_registration_init<'async_trait>(
self: Arc<Self>,
env: Environment<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sized + 'async_trait { ... }
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§
Provided Methods§
Sourcefn consensus_trust_root() -> Option<TrustRoot>
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.
Sourcefn new_transaction<B>(&self, method: &str, body: B) -> Transactionwhere
B: Encode,
fn new_transaction<B>(&self, method: &str, body: B) -> Transactionwhere
B: Encode,
Create a new unsigned transaction.
Sourcefn get_metadata<'async_trait>(
self: Arc<Self>,
env: Environment<Self>,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<String, String>>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
fn get_metadata<'async_trait>(
self: Arc<Self>,
env: Environment<Self>,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<String, String>>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
Fetches custom app instance metadata that is included in its on-chain registration.
This method is called before each registration refresh. Returning an error will not block registration, rather it will result in the metadata being cleared.
Sourcefn post_registration_init<'async_trait>(
self: Arc<Self>,
env: Environment<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
fn post_registration_init<'async_trait>(
self: Arc<Self>,
env: Environment<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
Custom post-registration initialization. It runs before any image-specific scripts are called by the runtime so it can be used to do things like set up custom storage after successful registration.
Sourcefn run<'async_trait>(
self: Arc<Self>,
env: Environment<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
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.
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.