pub fn singleton_with_key_factory<TKey, TSvc: Any + ?Sized, F>(
    factory: F
) -> ServiceDescriptor
where F: Fn(&ServiceProvider) -> Ref<TSvc> + 'static,
Available on crate feature builder only.
Expand description

Initializes a new keyed singleton ServiceDescriptor.

Arguments

  • factory - The factory method used to create the service