Function di::existing_with_key
source · pub fn existing_with_key<TKey, TSvc: Any + ?Sized, TImpl>(
instance: Box<TSvc>
) -> ServiceDescriptorAvailable on crate feature
builder only.Expand description
Creates a new singleton ServiceDescriptor for an existing service instance with a key.
Arguments
instance- The existing service instance
Remarks
This function maps an existing instance to a trait.