pub struct Key { /* private fields */ }Expand description
The pair of a type and a qualifier that a binding is stored under: Key::of::<PgPool, Replica>().
Two keys compare on their TypeIds alone, so a type alias or a renamed import reads the same
binding. A qualifier is any 'static type, usually a unit struct; () means unqualified.
An integration crate holding a Key at runtime looks it up erased through
Resolver::by_key.
Display writes a key through the TypeNames of its type and its qualifier, and a report
decides full paths per TypeName, not per key: Store @ a::Replica beside
Store @ b::Replica. Key::type_name is the key’s type.
Implementations§
Trait Implementations§
impl Copy for Key
Source§impl Display for Key
PgPool or PgPool @ Replica. A collection’s (collection) suffix is written by
KeyName, which carries the kind a bare Key does not. The alternate form, {:#}, writes
full type paths: my_app::db::PgPool @ my_app::Replica.
impl Display for Key
PgPool or PgPool @ Replica. A collection’s (collection) suffix is written by
KeyName, which carries the kind a bare Key does not. The alternate form, {:#}, writes
full type paths: my_app::db::PgPool @ my_app::Replica.