pub trait Query: Debug + Default + Sized + for<'d> QueryDb<'d> {
type Key: Clone + Debug + Hash + Eq;
type Value: Clone + Debug;
type Storage;
const QUERY_INDEX: u16;
const QUERY_NAME: &'static str;
// Required methods
fn query_storage<'a>(
group_storage: &'a <Self as QueryDb<'_>>::GroupStorage
) -> &'a Arc<Self::Storage>;
fn query_storage_mut<'a>(
group_storage: &'a <Self as QueryDb<'_>>::GroupStorage
) -> &'a Arc<Self::Storage>;
}
Expand description
Trait implements by all of the “special types” associated with each of your queries.
Required Associated Types§
Required Associated Constants§
sourceconst QUERY_INDEX: u16
const QUERY_INDEX: u16
A unique index identifying this query within the group.
sourceconst QUERY_NAME: &'static str
const QUERY_NAME: &'static str
Name of the query method (e.g., foo
)
Required Methods§
sourcefn query_storage<'a>(
group_storage: &'a <Self as QueryDb<'_>>::GroupStorage
) -> &'a Arc<Self::Storage>
fn query_storage<'a>( group_storage: &'a <Self as QueryDb<'_>>::GroupStorage ) -> &'a Arc<Self::Storage>
Extract storage for this query from the storage for its group.
sourcefn query_storage_mut<'a>(
group_storage: &'a <Self as QueryDb<'_>>::GroupStorage
) -> &'a Arc<Self::Storage>
fn query_storage_mut<'a>( group_storage: &'a <Self as QueryDb<'_>>::GroupStorage ) -> &'a Arc<Self::Storage>
Extract storage for this query from the storage for its group.
Object Safety§
This trait is not object safe.