pub trait HasState<T>: StateRegistry { }Expand description
Marker trait indicating that type T is present in state registry S.
This trait is automatically implemented for any type T that appears in the nested tuple structure of S.
§Example
ⓘ
// (DbPool, (Config, ())) contains both DbPool and Config
fn requires_db<S: HasState<DbPool>>() {}
fn requires_config<S: HasState<Config>>() {}
// Both work with (DbPool, (Config, ()))
type MyState = (DbPool, (Config, ()));
requires_db::<MyState>(); // compiles
requires_config::<MyState>(); // compiles