RuntimeFactory

Trait RuntimeFactory 

Source
pub trait RuntimeFactory {
    type Runtime: RuntimeTrait;

    // Required methods
    fn create<'async_trait>(
        options: RuntimeOptions,
    ) -> Pin<Box<dyn Future<Output = ForgeResult<Self::Runtime>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn create_with_config<'async_trait>(
        options: RuntimeOptions,
        config: ForgeConfig,
    ) -> Pin<Box<dyn Future<Output = ForgeResult<Self::Runtime>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn from_xml_schema_path<'life0, 'async_trait>(
        xml_schema_path: &'life0 str,
        options: Option<RuntimeOptions>,
        config: Option<ForgeConfig>,
    ) -> Pin<Box<dyn Future<Output = ForgeResult<Self::Runtime>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

运行时工厂 trait

提供统一的运行时创建接口

Required Associated Types§

Source

type Runtime: RuntimeTrait

运行时类型

Required Methods§

Source

fn create<'async_trait>( options: RuntimeOptions, ) -> Pin<Box<dyn Future<Output = ForgeResult<Self::Runtime>> + Send + 'async_trait>>
where Self: 'async_trait,

创建运行时实例

§参数
  • options - 运行时选项
§返回值
  • ForgeResult<Self::Runtime> - 运行时实例
Source

fn create_with_config<'async_trait>( options: RuntimeOptions, config: ForgeConfig, ) -> Pin<Box<dyn Future<Output = ForgeResult<Self::Runtime>> + Send + 'async_trait>>
where Self: 'async_trait,

使用配置创建运行时实例

§参数
  • options - 运行时选项
  • config - 运行时配置
Source

fn from_xml_schema_path<'life0, 'async_trait>( xml_schema_path: &'life0 str, options: Option<RuntimeOptions>, config: Option<ForgeConfig>, ) -> Pin<Box<dyn Future<Output = ForgeResult<Self::Runtime>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

从XML Schema创建运行时

§参数
  • xml_schema_path - XML Schema文件路径
  • options - 可选的运行时选项
  • config - 可选的运行时配置

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.

Implementors§