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§
Sourcefn dependencies(&self) -> Vec<Dependency>
fn dependencies(&self) -> Vec<Dependency>
Dependencies required by this runtime.
Sourcefn main_attribute(&self) -> Option<String>
fn main_attribute(&self) -> Option<String>
Attribute to apply to async main function (e.g., #[tokio::main]).
Sourcefn generate_init(&self, info: &RuntimeInfo) -> Option<Vec<CodeFragment>>
fn generate_init(&self, info: &RuntimeInfo) -> Option<Vec<CodeFragment>>
Generate any runtime initialization code.
Sourcefn imports(&self) -> Vec<ImportSpec>
fn imports(&self) -> Vec<ImportSpec>
Imports needed for runtime code.