pub struct IocContainerBuilder { /* private fields */ }
Expand description
Builder for IoC container with fluent API
Implementations§
Trait Implementations§
Source§impl Debug for IocContainerBuilder
impl Debug for IocContainerBuilder
Source§impl Default for IocContainerBuilder
impl Default for IocContainerBuilder
Source§impl ServiceBinder for IocContainerBuilder
impl ServiceBinder for IocContainerBuilder
Source§fn add_service_descriptor(
&mut self,
descriptor: ServiceDescriptor,
) -> Result<&mut Self, CoreError>
fn add_service_descriptor( &mut self, descriptor: ServiceDescriptor, ) -> Result<&mut Self, CoreError>
Add a pre-built service descriptor
Source§fn bind<TInterface: ?Sized + 'static, TImpl: Send + Sync + Default + 'static>(
&mut self,
) -> &mut Self
fn bind<TInterface: ?Sized + 'static, TImpl: Send + Sync + Default + 'static>( &mut self, ) -> &mut Self
Bind an interface to an implementation
Source§fn bind_singleton<TInterface: ?Sized + 'static, TImpl: Send + Sync + Default + 'static>(
&mut self,
) -> &mut Self
fn bind_singleton<TInterface: ?Sized + 'static, TImpl: Send + Sync + Default + 'static>( &mut self, ) -> &mut Self
Bind an interface to an implementation with singleton lifetime
Source§fn bind_transient<TInterface: ?Sized + 'static, TImpl: Send + Sync + Default + 'static>(
&mut self,
) -> &mut Self
fn bind_transient<TInterface: ?Sized + 'static, TImpl: Send + Sync + Default + 'static>( &mut self, ) -> &mut Self
Bind an interface to an implementation with transient lifetime
Source§fn bind_factory<TInterface: ?Sized + 'static, F, T>(
&mut self,
factory: F,
) -> &mut Self
fn bind_factory<TInterface: ?Sized + 'static, F, T>( &mut self, factory: F, ) -> &mut Self
Bind a service using a factory function
Source§fn bind_instance<TInterface: ?Sized + 'static, TImpl: Send + Sync + Clone + 'static>(
&mut self,
instance: TImpl,
) -> &mut Self
fn bind_instance<TInterface: ?Sized + 'static, TImpl: Send + Sync + Clone + 'static>( &mut self, instance: TImpl, ) -> &mut Self
Bind a pre-created instance
Source§fn bind_named<TInterface: ?Sized + 'static, TImpl: Send + Sync + Default + 'static>(
&mut self,
name: &str,
) -> &mut Self
fn bind_named<TInterface: ?Sized + 'static, TImpl: Send + Sync + Default + 'static>( &mut self, name: &str, ) -> &mut Self
Bind a named service
Source§fn bind_injectable<T: Injectable>(&mut self) -> &mut Self
fn bind_injectable<T: Injectable>(&mut self) -> &mut Self
Bind an Injectable service with auto-wiring
Source§fn bind_injectable_singleton<T: Injectable>(&mut self) -> &mut Self
fn bind_injectable_singleton<T: Injectable>(&mut self) -> &mut Self
Bind an Injectable service as singleton with auto-wiring
Source§fn bind_with<TInterface: ?Sized + 'static, TImpl: Send + Sync + Default + 'static>(
&mut self,
) -> AdvancedBindingBuilder<TInterface>
fn bind_with<TInterface: ?Sized + 'static, TImpl: Send + Sync + Default + 'static>( &mut self, ) -> AdvancedBindingBuilder<TInterface>
Advanced bind with fluent configuration - returns builder for chaining
Source§fn with_implementation<TInterface: ?Sized + 'static, TImpl: Send + Sync + Default + 'static>(
&mut self,
config: BindingConfig,
) -> &mut Self
fn with_implementation<TInterface: ?Sized + 'static, TImpl: Send + Sync + Default + 'static>( &mut self, config: BindingConfig, ) -> &mut Self
Complete advanced binding with implementation
Source§fn bind_lazy<TInterface: ?Sized + 'static, F, T>(
&mut self,
factory: F,
) -> &mut Self
fn bind_lazy<TInterface: ?Sized + 'static, F, T>( &mut self, factory: F, ) -> &mut Self
Bind a lazy service using factory that gets called only when needed
Source§fn bind_parameterized_factory<TInterface: ?Sized + 'static, P, F, T>(
&mut self,
factory: F,
) -> &mut Self
fn bind_parameterized_factory<TInterface: ?Sized + 'static, P, F, T>( &mut self, factory: F, ) -> &mut Self
Bind with parameterized factory
Source§fn bind_collection<TInterface: ?Sized + 'static, F>(
&mut self,
configure: F,
) -> &mut Selfwhere
F: FnOnce(&mut CollectionBindingBuilder<TInterface>),
fn bind_collection<TInterface: ?Sized + 'static, F>(
&mut self,
configure: F,
) -> &mut Selfwhere
F: FnOnce(&mut CollectionBindingBuilder<TInterface>),
Bind a collection of services using a closure-based configuration
Auto Trait Implementations§
impl Freeze for IocContainerBuilder
impl !RefUnwindSafe for IocContainerBuilder
impl Send for IocContainerBuilder
impl Sync for IocContainerBuilder
impl Unpin for IocContainerBuilder
impl !UnwindSafe for IocContainerBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more