AsAnyAsyncEngine

Trait AsAnyAsyncEngine 

Source
pub trait AsAnyAsyncEngine {
    // Required method
    fn into_any_engine(self) -> Arc<dyn AnyAsyncEngine>;
}
Expand description

An extension trait that provides a convenient way to type-erase an AsyncEngine.

This trait provides the .into_any_engine() method on any Arc<dyn AsyncEngine<...>>, enabling ergonomic type erasure without explicit wrapper construction.

§Usage

use crate::engine::AsAnyAsyncEngine;

let typed_engine: Arc<dyn AsyncEngine<String, String, ()>> = Arc::new(MyEngine::new());
let any_engine = typed_engine.into_any_engine();

Required Methods§

Source

fn into_any_engine(self) -> Arc<dyn AnyAsyncEngine>

Converts a typed AsyncEngine into a type-erased AnyAsyncEngine.

Implementations on Foreign Types§

Source§

impl<Req, Resp, E> AsAnyAsyncEngine for Arc<dyn AsyncEngine<Req, Resp, E>>
where Req: Data, Resp: Data + AsyncEngineContextProvider, E: Data,

Implementors§