Trait shaku::HasComponent [−][src]
Indicates that a module contains a component which implements the interface.
Required methods
fn build_component(context: &mut ModuleBuildContext<Self>) -> Arc<I> where
Self: Module + Sized,
[src]
Self: Module + Sized,
Build the component during module build. Usually this involves calling
ModuleBuildContext::build_component
with the implementation.
fn resolve(&self) -> Arc<I>
[src]
Get a reference to the component. The ownership of the component is
shared via Arc
.
Example
let foo: Arc<dyn Foo> = module.resolve();