pub struct SingletonFactory { /* private fields */ }Expand description
Singleton factory - stores a single pre-created instance
Optimization: Stores type-erased Arc<dyn Any> directly to avoid
clone+cast on every resolution.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SingletonFactory
impl !RefUnwindSafe for SingletonFactory
impl Send for SingletonFactory
impl Sync for SingletonFactory
impl Unpin for SingletonFactory
impl !UnwindSafe for SingletonFactory
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
Source§impl<T> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging