Driver

Trait Driver 

Source
pub trait Driver {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn node_id(&self) -> String;
    fn get_nodes<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn start<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

The driver trait, which defines the node list management interface.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn node_id(&self) -> String

Get the local node id.

Source

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

Get the node list in the cluster

Provided Methods§

Source

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

Start the driver, blocking the current thread.

Implementors§