pub trait Query: Copy + 'static {
// Required methods
fn setup(&self, context: &Context);
fn get_query(&self) -> Vec<(TypeId, HashValueType)>;
fn get_type_ids(&self) -> Vec<TypeId>;
fn multi_property_value_hash(&self) -> HashValueType;
// Provided method
fn multi_property_type_id(&self) -> Option<TypeId> { ... }
}
Expand description
Encapsulates a person query.
Context::query_people
actually takes an instance of Query
, but because
we implement Query for tuples of up to size 20, that’s invisible
to the caller. Do not use this trait directly.
Required Methods§
fn setup(&self, context: &Context)
Sourcefn get_query(&self) -> Vec<(TypeId, HashValueType)>
fn get_query(&self) -> Vec<(TypeId, HashValueType)>
Returns a list of (type_id, hash)
pairs where hash
is the hash of a value of type
Property::Value
and type_id
is Property.type_id()
(NOT the type ID of the value).
Sourcefn get_type_ids(&self) -> Vec<TypeId>
fn get_type_ids(&self) -> Vec<TypeId>
Returns an unordered list of type IDs of the properties in this query.
fn multi_property_value_hash(&self) -> HashValueType
Provided Methods§
Sourcefn multi_property_type_id(&self) -> Option<TypeId>
fn multi_property_type_id(&self) -> Option<TypeId>
Returns the TypeId
of the multi-property having the properties of this query, if any.
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.