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.Source§fn specialized_flatten_id(&self) -> Option<Cow<'_, IdStaticSet>>
fn specialized_flatten_id(&self) -> Option<Cow<'_, IdStaticSet>>
Auto Trait Implementations§
impl !Freeze for MetaSet
impl !RefUnwindSafe for MetaSet
impl Send for MetaSet
impl Sync for MetaSet
impl Unpin for MetaSet
impl UnsafeUnpin for MetaSet
impl !UnwindSafe for MetaSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more