Skip to main content

Module key

Module key 

Source
Expand description

Service keys for keyed registrations.

A key is either a typed value (Eq + Hash + Debug, any type) or the special ServiceKey::any_key sentinel used for “fallback for any key” registrations (MEDI KeyedService.AnyKey parity).

String keys used by keyed_singleton("name", …) are just typed keys whose value is a String, so existing string-keyed code keeps working while typed keys enable MEDI-style keyed services (enums, integers, …).

Structs§

KeyedService
MEDI-inspired namespace for the AnyKey sentinel.
ServiceKey
Key of a keyed service registration / resolution.