1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright © 2026 Kirky.X. All rights reserved.
//! Capability key trait for identifying and typing capabilities.
/// The key trait for identifying capabilities in Kit.
///
/// Each capability is identified by a unique key type that implements this trait.
/// The `Capability` associated type specifies the trait object type of the capability.
/// The `NAME` constant provides a diagnostic name for error messages.
///
/// # Type Constraints
///
/// The `Capability` type must satisfy:
/// - `?Sized` — allows trait objects like `dyn SomeTrait`
/// - `Send + Sync + 'static` — required for thread-safe storage in Kit
///
/// The key type itself must satisfy `'static` for TypeId stability.
///
/// # Example
///
/// ```
/// use trait_kit::core::capability::CapabilityKey;
///
/// struct MyKey;
/// impl CapabilityKey for MyKey {
/// type Capability = dyn Send + Sync;
/// const NAME: &'static str = "my_key";
/// }
///
/// let _ = MyKey::NAME;
/// ```