Trait AsyncNameSetQuery

Source
pub trait AsyncNameSetQuery:
    Any
    + Debug
    + Send
    + Sync {
    // 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<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn first<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<VertexName>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn last<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<VertexName>>> + 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 VertexName,
    ) -> 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 VertexName,
    ) -> 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> { ... }
}
Expand description

Read-only queries required by NameSet: Iteration, length and contains.

Types implementating this trait should rewrite methods to use fast paths when possible.

Required Methods§

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,

Iterate through the set in defined order.

Source

fn as_any(&self) -> &dyn Any

For downcasting.

Source

fn hints(&self) -> &Hints

Get or set optimization hints.

Provided Methods§

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,

Iterate through the set in the reversed order.

Source

fn count<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Number of names in this set.

Source

fn first<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<VertexName>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The first name in the set.

Source

fn last<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<VertexName>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The last name in the set.

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,

Test if this set is empty.

Source

fn contains<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 VertexName, ) -> 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.

Source

fn contains_fast<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 VertexName, ) -> 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.

Source

fn id_convert(&self) -> Option<&dyn IdConvert>

Get an optional IdConvert interface to check hints.

Implementors§