rust_nebula::graph::query

Trait GraphQuery

source
pub trait GraphQuery {
    type Error: From<GraphQueryError> + Error;

    // Required method
    fn query<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        stmt: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<GraphQueryOutput, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn execute<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        stmt: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn show_hosts<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Host>, Self::Error>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn show_spaces<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Space>, Self::Error>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
}

Required Associated Types§

Required Methods§

source

fn query<'life0, 'life1, 'async_trait>( &'life0 mut self, stmt: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<GraphQueryOutput, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute stmt and return the query output.

§Notice

For operation that doesn’t return result, like CREATE TAG, USE space etc. it’s recommended to use execute(stmt).

Provided Methods§

source

fn execute<'life0, 'life1, 'async_trait>( &'life0 mut self, stmt: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute stmt and doesn’t return the execution output.

source

fn show_hosts<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Host>, Self::Error>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

source

fn show_spaces<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Space>, Self::Error>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Implementors§

source§

impl<T> GraphQuery for SingleConnSession<T>
where T: Transport + Send + Sync + Framing<DecBuf = Cursor<Bytes>>, Bytes: Framing<DecBuf = <T as Framing>::DecBuf>, <<BinaryProtocol as Protocol>::Frame as Framing>::EncBuf: BufMutExt<Final = <<T as Framing>::EncBuf as BufMutExt>::Final>,