pub trait Builder: Send + Sync {
// Required methods
fn instance_type_id(&self) -> TypeId;
fn instance_type_name(&self) -> &'static str;
fn interfaces(&self) -> Vec<InterfaceDesc>;
fn get(
&self,
cat: &Catalog
) -> Result<Arc<dyn Any + Send + Sync>, InjectionError>;
fn check(&self, cat: &Catalog) -> Result<(), ValidationError>;
}
Expand description
Builders are responsible for resolving dependencies and creating new instances of a certain type. Builders typically create new instances for every call, delegating the lifetime management to Scopes,
Required Methods§
fn instance_type_id(&self) -> TypeId
fn instance_type_name(&self) -> &'static str
fn interfaces(&self) -> Vec<InterfaceDesc>
fn get( &self, cat: &Catalog ) -> Result<Arc<dyn Any + Send + Sync>, InjectionError>
fn check(&self, cat: &Catalog) -> Result<(), ValidationError>
Implementations on Foreign Types§
source§impl<Impl> Builder for Arc<Impl>where
Impl: Send + Sync + 'static,
impl<Impl> Builder for Arc<Impl>where Impl: Send + Sync + 'static,
Arc