pub trait Vm: AppHandler + Connector + Checkable {
    // Required methods
    fn initialize<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 mut self,
        ctx: Option<Context>,
        db_manager: Box<dyn Manager + Send + Sync>,
        genesis_bytes: &'life1 [u8],
        upgrade_bytes: &'life2 [u8],
        config_bytes: &'life3 [u8],
        to_engine: Sender<Message>,
        fxs: &'life4 [Fx],
        app_sender: Box<dyn AppSender + Send + Sync>
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
    fn set_state<'life0, 'async_trait>(
        &'life0 self,
        state: State
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn shutdown<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn version<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn create_static_handlers<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, HttpHandler>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn create_handlers<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, HttpHandler>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Vm describes the trait that all consensus VMs must implement.

ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/snow/engine/common#Vm

Required Methods§

source

fn initialize<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 mut self, ctx: Option<Context>, db_manager: Box<dyn Manager + Send + Sync>, genesis_bytes: &'life1 [u8], upgrade_bytes: &'life2 [u8], config_bytes: &'life3 [u8], to_engine: Sender<Message>, fxs: &'life4 [Fx], app_sender: Box<dyn AppSender + Send + Sync> ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

source

fn set_state<'life0, 'async_trait>( &'life0 self, state: State ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source

fn shutdown<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source

fn version<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source

fn create_static_handlers<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, HttpHandler>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source

fn create_handlers<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, HttpHandler>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Implementors§