pub trait Runtime {
    type Core: API;
    type Accounts: API;
    type Modules: TransactionHandler + MigrationHandler + MethodHandler + BlockHandler + InvariantHandler + ModuleInfoHandler;
    type FeeProxy: FeeProxyHandler = ();
    const VERSION: Version;
    const STATE_VERSION: u32 = 0u32;
    const PREFETCH_LIMIT: u16 = 0u16;
    const SCHEDULE_CONTROL: ScheduleControl = _;
    const MAX_CHECK_NONCE_FUTURE_DELTA: u64 = 0u64;
    // Required method
    fn genesis_state() -> <Self::Modules as MigrationHandler>::Genesis;
    // Provided methods
    fn trusted_signers() -> Option<TrustedSigners> { ... }
    fn consensus_trust_root() -> Option<TrustRoot> { ... }
    fn migrate_state<C: Context>(_ctx: &C) { ... }
    fn is_allowed_query(_method: &str) -> bool { ... }
    fn is_allowed_private_km_query(_method: &str) -> bool { ... }
    fn is_allowed_interactive_call(_method: &str) -> bool { ... }
    fn migrate<C: Context>(ctx: &C) { ... }
    fn start()
       where Self: Sized + Send + Sync + 'static { ... }
}Expand description
A runtime.
Required Associated Constants§
Provided Associated Constants§
Sourceconst STATE_VERSION: u32 = 0u32
 
const STATE_VERSION: u32 = 0u32
State version.
Sourceconst PREFETCH_LIMIT: u16 = 0u16
 
const PREFETCH_LIMIT: u16 = 0u16
Prefetch limit. To enable prefetch set it to a non-zero value.
Sourceconst SCHEDULE_CONTROL: ScheduleControl = _
 
const SCHEDULE_CONTROL: ScheduleControl = _
Runtime schedule control configuration.
Sourceconst MAX_CHECK_NONCE_FUTURE_DELTA: u64 = 0u64
 
const MAX_CHECK_NONCE_FUTURE_DELTA: u64 = 0u64
Maximum delta that the transaction nonce can be in the future from the current nonce to still be accepted during transaction checks.
Required Associated Types§
Sourcetype Modules: TransactionHandler + MigrationHandler + MethodHandler + BlockHandler + InvariantHandler + ModuleInfoHandler
 
type Modules: TransactionHandler + MigrationHandler + MethodHandler + BlockHandler + InvariantHandler + ModuleInfoHandler
Supported modules.
Provided Associated Types§
Sourcetype FeeProxy: FeeProxyHandler = ()
 
type FeeProxy: FeeProxyHandler = ()
Handler for proxy fee payments.
Required Methods§
Sourcefn genesis_state() -> <Self::Modules as MigrationHandler>::Genesis
 
fn genesis_state() -> <Self::Modules as MigrationHandler>::Genesis
Genesis state for the runtime.
Provided Methods§
Sourcefn trusted_signers() -> Option<TrustedSigners>
 
fn trusted_signers() -> Option<TrustedSigners>
Return the trusted signers for this runtime; if None, a key manager connection will not be
established on startup.
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 migrate_state<C: Context>(_ctx: &C)
 
fn migrate_state<C: Context>(_ctx: &C)
Perform runtime-specific state migration. This method is only called when the recorded
state version does not match STATE_VERSION.
Sourcefn is_allowed_query(_method: &str) -> bool
 
fn is_allowed_query(_method: &str) -> bool
Whether a given query method is allowed to be invoked.
Sourcefn is_allowed_private_km_query(_method: &str) -> bool
 
fn is_allowed_private_km_query(_method: &str) -> bool
Whether a given query method is allowed to access private key manager state.
Note that even if this returns true for a method, the method also needs to be tagged as
being allowed to access private key manager state (e.g. with allow_private_km).
Sourcefn is_allowed_interactive_call(_method: &str) -> bool
 
fn is_allowed_interactive_call(_method: &str) -> bool
Whether a given call is allowed to be invoked interactively.
Note that even if this returns true for a method, the method also needs to be tagged as
being allowed to be executed interactively (e.g. with allow_interactive)
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.