Trait QueryBase

Source
pub trait QueryBase:
    Debug
    + Default
    + Sized {
    type Key: Clone + Debug + Hash + Eq;
    type Value: Clone + Debug;
    type Storage;
    type Group: QueryGroup<GroupStorage = Self::GroupStorage>;
    type GroupStorage;

    const QUERY_INDEX: u16;
    const QUERY_NAME: &'static str;

    // Required method
    fn query_storage<'a>(
        group_storage: &'a Self::GroupStorage,
    ) -> &'a Arc<Self::Storage>;
}
Expand description

Trait implements by all of the “special types” associated with each of your queries.

Required Associated Constants§

Source

const QUERY_INDEX: u16

A unique index identifying this query within the group.

Source

const QUERY_NAME: &'static str

Name of the query method (e.g., foo)

Required Associated Types§

Source

type Key: Clone + Debug + Hash + Eq

Type that you you give as a parameter – for queries with zero or more than one input, this will be a tuple.

Source

type Value: Clone + Debug

What value does the query return?

Source

type Storage

Internal struct storing the values for the query.

Source

type Group: QueryGroup<GroupStorage = Self::GroupStorage>

Associate query group struct.

Source

type GroupStorage

Generated struct that contains storage for all queries in a group.

Required Methods§

Source

fn query_storage<'a>( group_storage: &'a Self::GroupStorage, ) -> &'a Arc<Self::Storage>

Extact storage for this query from the storage for its group.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§