Skip to main content

bind_factory

Macro bind_factory 

Source
macro_rules! bind_factory {
    ($trait:ty, $factory:expr) => { ... };
}
Expand description

Bind a trait to a factory (auto-wraps in Arc, new instance each resolution)

§Example

bind_factory!(dyn HttpClient, || RealHttpClient::new());