pub trait AsyncSetQuery:
Any
+ Debug
+ Send
+ Sync {
Show 17 methods
// Required methods
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 as_any(&self) -> &dyn Any;
fn hints(&self) -> &Hints;
// Provided methods
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 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_slow<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<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 { ... }
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 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 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 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_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 id_convert(&self) -> Option<&dyn IdConvert> { ... }
fn specialized_reverse(&self) -> Option<Set> { ... }
fn specialized_take(&self, n: u64) -> Option<Set> { ... }
fn specialized_skip(&self, n: u64) -> Option<Set> { ... }
fn specialized_flatten_id(&self) -> Option<Cow<'_, IdStaticSet>> { ... }
}Expand description
Read-only queries required by Set: Iteration, length and contains.
Types implementating this trait should rewrite methods to use fast paths when possible.
Required Methods§
Provided Methods§
Sourcefn 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,
Iterate through the set in the reversed order.
Sourcefn 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,
Number of names in this set. Do not override.
This function has some built-in fast paths. For individual set types, override count_slow, size_hint instead of count.
Sourcefn 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,
“Slow” count implementation. Intended to be overridden.
This is intended to be implemented by individual set types as fallbacks when the universal fast paths do not work.
Sourcefn 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,
Returns the bounds on the length of the set as a hint. The first item is the lower bound. The second item is the upper bound. This method should not block on long operations like waiting for network.
Sourcefn 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,
The first name in the set.
Sourcefn 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,
The last name in the set.
Sourcefn 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,
Test if this set is empty.
Sourcefn 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,
Test if this set contains a given name.
Sourcefn 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,
Test contains in less than O(N) time. Returns None if cannot achieve in less than O(N) time.
Sourcefn id_convert(&self) -> Option<&dyn IdConvert>
fn id_convert(&self) -> Option<&dyn IdConvert>
Get an optional IdConvert interface to check hints.
Sourcefn specialized_reverse(&self) -> Option<Set>
fn specialized_reverse(&self) -> Option<Set>
Specialized “reverse” implementation.
Returns None to use the general purpose reverse implementation.
Sourcefn specialized_take(&self, n: u64) -> Option<Set>
fn specialized_take(&self, n: u64) -> Option<Set>
Specialized “take” implementation.
Returns None to use the general purpose implementation.
Sourcefn specialized_skip(&self, n: u64) -> Option<Set>
fn specialized_skip(&self, n: u64) -> Option<Set>
Specialized “take” implementation.
Returns None to use the general purpose implementation.
Sourcefn specialized_flatten_id(&self) -> Option<Cow<'_, IdStaticSet>>
fn specialized_flatten_id(&self) -> Option<Cow<'_, IdStaticSet>>
Specialized “flatten_id” implementation.