RuntimeAdapter

Trait RuntimeAdapter 

Source
pub trait RuntimeAdapter {
    // Required methods
    fn name(&self) -> &'static str;
    fn dependencies(&self) -> Vec<Dependency>;
    fn main_attribute(&self) -> Option<String>;
    fn generate_init(&self, info: &RuntimeInfo) -> Option<Vec<CodeFragment>>;
    fn imports(&self) -> Vec<ImportSpec>;
}
Expand description

Trait for async runtime adapters.

Implement this trait to support a specific async runtime (tokio, async-std, etc.).

Required Methods§

Source

fn name(&self) -> &'static str

Adapter name for identification.

Source

fn dependencies(&self) -> Vec<Dependency>

Dependencies required by this runtime.

Source

fn main_attribute(&self) -> Option<String>

Attribute to apply to async main function (e.g., #[tokio::main]).

Source

fn generate_init(&self, info: &RuntimeInfo) -> Option<Vec<CodeFragment>>

Generate any runtime initialization code.

Source

fn imports(&self) -> Vec<ImportSpec>

Imports needed for runtime code.

Implementors§