Struct mentat_query_algebrizer::Known
[−]
[src]
pub struct Known<'s, 'c> { pub schema: &'s Schema, pub cache: Option<&'c CachedAttributes>, }
A convenience wrapper around things known in memory: the schema and caches. We use a trait object here to avoid making dozens of functions generic over the type of the cache. If performance becomes a concern, we should hard-code specific kinds of cache right here, and/or eliminate the Option.
Fields
schema: &'s Schema
cache: Option<&'c CachedAttributes>
Methods
impl<'s, 'c> Known<'s, 'c>
[src]
pub fn for_schema(s: &'s Schema) -> Known<'s, 'static>
[src]
pub fn new(s: &'s Schema, c: Option<&'c CachedAttributes>) -> Known<'s, 'c>
[src]
impl<'s, 'c> Known<'s, 'c>
[src]
This is CachedAttributes
, but with handy generic parameters.
Why not make the trait generic? Because then we can't use it as a trait object in Known
.
pub fn is_attribute_cached_reverse<U>(&self, entid: U) -> bool where
U: Into<Entid>,
[src]
U: Into<Entid>,
pub fn is_attribute_cached_forward<U>(&self, entid: U) -> bool where
U: Into<Entid>,
[src]
U: Into<Entid>,
pub fn get_values_for_entid<U, V>(
&self,
schema: &Schema,
attribute: U,
entid: V
) -> Option<&Vec<TypedValue>> where
U: Into<Entid>,
V: Into<Entid>,
[src]
&self,
schema: &Schema,
attribute: U,
entid: V
) -> Option<&Vec<TypedValue>> where
U: Into<Entid>,
V: Into<Entid>,
pub fn get_value_for_entid<U, V>(
&self,
schema: &Schema,
attribute: U,
entid: V
) -> Option<&TypedValue> where
U: Into<Entid>,
V: Into<Entid>,
[src]
&self,
schema: &Schema,
attribute: U,
entid: V
) -> Option<&TypedValue> where
U: Into<Entid>,
V: Into<Entid>,
pub fn get_entid_for_value<U>(
&self,
attribute: U,
value: &TypedValue
) -> Option<Entid> where
U: Into<Entid>,
[src]
&self,
attribute: U,
value: &TypedValue
) -> Option<Entid> where
U: Into<Entid>,
pub fn get_entids_for_value<U>(
&self,
attribute: U,
value: &TypedValue
) -> Option<&BTreeSet<Entid>> where
U: Into<Entid>,
[src]
&self,
attribute: U,
value: &TypedValue
) -> Option<&BTreeSet<Entid>> where
U: Into<Entid>,
Trait Implementations
impl<'s, 'c> Clone for Known<'s, 'c>
[src]
fn clone(&self) -> Known<'s, 'c>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more