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§
Required Methods§
Sourcefn 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 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.
Sourcefn execute<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 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,
Start running the protocol.
Sourcefn into_transport(self) -> Transport
fn into_transport(self) -> Transport
Consume this driver into the underlying transport.