pub struct MetaSet { /* private fields */ }Expand description
A set that is lazily evaluated to another set on access, with an optional fast path for “contains”.
This can be useful for various cases. Especially when “contains” and “iter”
have separate fast paths. For example, merge() (merge commits) obviously
has a cheap “contains” fast path by checking if a given commit has
multiple parents. However, if we want to iterating through the set,
segmented changelog has a fast path by iterating flat segments, instead
of testing commits one by one using the “contains” check.
MetaSet is different from LazySet: MetaSet’s evaluate function can
return static or lazy or meta sets. LazySet does not support a “contains”
fast path (yet).
MetaSet is different from a pure filtering set (ex. only has “contains”
fast path), as MetaSet supports fast path for iteration, if the underlying
set supports it.
Implementations§
Source§impl MetaSet
impl MetaSet
Sourcepub fn from_evaluate_hints(
evaluate: Box<dyn Fn() -> BoxFuture<'static, Result<Set>> + Send + Sync + 'static>,
hints: Hints,
) -> Self
pub fn from_evaluate_hints( evaluate: Box<dyn Fn() -> BoxFuture<'static, Result<Set>> + Send + Sync + 'static>, hints: Hints, ) -> Self
Constructs MetaSet from an evaluate function that returns a
Set. The evaluate function is not called immediately.
Trait Implementations§
Source§impl AsyncSetQuery for MetaSet
impl AsyncSetQuery for MetaSet
Source§fn iter<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BoxVertexStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn iter<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BoxVertexStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn iter_rev<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BoxVertexStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn iter_rev<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BoxVertexStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn count_slow<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_slow<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn size_hint<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = (u64, Option<u64>)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn size_hint<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = (u64, Option<u64>)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn last<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vertex>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn last<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vertex>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn contains<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 Vertex,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn contains<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 Vertex,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn contains_fast<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 Vertex,
) -> Pin<Box<dyn Future<Output = Result<Option<bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn contains_fast<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 Vertex,
) -> Pin<Box<dyn Future<Output = Result<Option<bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn first<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vertex>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn first<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vertex>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn id_convert(&self) -> Option<&dyn IdConvert>
fn id_convert(&self) -> Option<&dyn IdConvert>
Source§fn specialized_reverse(&self) -> Option<Set>
fn specialized_reverse(&self) -> Option<Set>
None to use the general purpose reverse implementation.Source§fn specialized_take(&self, n: u64) -> Option<Set>
fn specialized_take(&self, n: u64) -> Option<Set>
None to use the general purpose implementation.Source§fn specialized_skip(&self, n: u64) -> Option<Set>
fn specialized_skip(&self, n: u64) -> Option<Set>
None to use the general purpose implementation.