Trait Query

Source
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§

Source

fn setup(&self, context: &Context)

Source

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).

Source

fn get_type_ids(&self) -> Vec<TypeId>

Returns an unordered list of type IDs of the properties in this query.

Source

fn multi_property_value_hash(&self) -> HashValueType

Provided Methods§

Source

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.

Implementations on Foreign Types§

Source§

impl Query for ()

Source§

impl<T0: PersonProperty, T1: PersonProperty> Query for ((T0, T0::Value), (T1, T1::Value))

Source§

impl<T0: PersonProperty, T1: PersonProperty, T2: PersonProperty> Query for ((T0, T0::Value), (T1, T1::Value), (T2, T2::Value))

Source§

impl<T0: PersonProperty, T1: PersonProperty, T2: PersonProperty, T3: PersonProperty> Query for ((T0, T0::Value), (T1, T1::Value), (T2, T2::Value), (T3, T3::Value))

Source§

impl<T0: PersonProperty, T1: PersonProperty, T2: PersonProperty, T3: PersonProperty, T4: PersonProperty> Query for ((T0, T0::Value), (T1, T1::Value), (T2, T2::Value), (T3, T3::Value), (T4, T4::Value))

Source§

impl<T0: PersonProperty, T1: PersonProperty, T2: PersonProperty, T3: PersonProperty, T4: PersonProperty, T5: PersonProperty> Query for ((T0, T0::Value), (T1, T1::Value), (T2, T2::Value), (T3, T3::Value), (T4, T4::Value), (T5, T5::Value))

Source§

impl<T0: PersonProperty, T1: PersonProperty, T2: PersonProperty, T3: PersonProperty, T4: PersonProperty, T5: PersonProperty, T6: PersonProperty> Query for ((T0, T0::Value), (T1, T1::Value), (T2, T2::Value), (T3, T3::Value), (T4, T4::Value), (T5, T5::Value), (T6, T6::Value))

Source§

impl<T0: PersonProperty, T1: PersonProperty, T2: PersonProperty, T3: PersonProperty, T4: PersonProperty, T5: PersonProperty, T6: PersonProperty, T7: PersonProperty> Query for ((T0, T0::Value), (T1, T1::Value), (T2, T2::Value), (T3, T3::Value), (T4, T4::Value), (T5, T5::Value), (T6, T6::Value), (T7, T7::Value))

Source§

impl<T0: PersonProperty, T1: PersonProperty, T2: PersonProperty, T3: PersonProperty, T4: PersonProperty, T5: PersonProperty, T6: PersonProperty, T7: PersonProperty, T8: PersonProperty> Query for ((T0, T0::Value), (T1, T1::Value), (T2, T2::Value), (T3, T3::Value), (T4, T4::Value), (T5, T5::Value), (T6, T6::Value), (T7, T7::Value), (T8, T8::Value))

Source§

impl<T1: PersonProperty> Query for ((T1, T1::Value),)

Source§

impl<T1: PersonProperty> Query for (T1, T1::Value)

Implementors§