mpc_client

Trait Driver

Source
pub trait Driver {
    type Output;

    // Required methods
    fn handle_event<'life0, 'async_trait>(
        &'life0 mut self,
        event: Event,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Output>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn execute<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn into_transport(self) -> Transport;
}
Expand description

Drives a protocol to completion bridging between the network transport and local computation.

Required Associated Types§

Source

type Output

Output yielded when the driver completes.

Required Methods§

Source

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

Handle an incoming event.

Source

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

Start running the protocol.

Source

fn into_transport(self) -> Transport

Consume this driver into the underlying transport.

Implementors§