[][src]Trait salsa::Query

pub trait Query: Debug + Default + Sized + 'static {
    type Key: Clone + Debug + Hash + Eq;
    type Value: Clone + Debug;
    type Storage: QueryStorageOps<Self>;
    type Group: QueryGroup<DynDb = Self::DynDb, GroupStorage = Self::GroupStorage>;
    type GroupStorage;
    type DynDb: ?Sized + Database + HasQueryGroup<Self::Group>;

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

    fn query_storage(group_storage: &Self::GroupStorage) -> &Arc<Self::Storage>;
}

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

Associated Types

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.

type Value: Clone + Debug

What value does the query return?

type Storage: QueryStorageOps<Self>

Internal struct storing the values for the query.

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

Associate query group struct.

type GroupStorage

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

type DynDb: ?Sized + Database + HasQueryGroup<Self::Group>

Dyn version of the associated trait for this query group.

Loading content...

Associated Constants

const QUERY_INDEX: u16

A unique index identifying this query within the group.

const QUERY_NAME: &'static str

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

Loading content...

Required methods

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

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

Loading content...

Implementors

Loading content...