Trait twizzler_driver::request::RequestDriver
source · pub trait RequestDriver {
type Request: Copy + Send;
type Response: Copy + Send;
type SubmitError;
const NUM_IDS: usize;
// Required methods
fn submit<'life0, 'life1, 'async_trait>(
&'life0 self,
reqs: &'life1 mut [SubmitRequest<Self::Request>]
) -> Pin<Box<dyn Future<Output = Result<(), Self::SubmitError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn flush(&self);
}
Expand description
A trait implemented by a particular driver that can the be used by a requester::Requester.
Required Associated Types§
sourcetype Request: Copy + Send
type Request: Copy + Send
The type of a request that will be used by the SubmitRequest wrapper to submit requests to the driver.
sourcetype Response: Copy + Send
type Response: Copy + Send
The type of a response to a request that we will use to send back to the Requester via the requester::Requester::finish function.
sourcetype SubmitError
type SubmitError
The type of a submit error in case submission fails.
Required Associated Constants§
Required Methods§
sourcefn submit<'life0, 'life1, 'async_trait>(
&'life0 self,
reqs: &'life1 mut [SubmitRequest<Self::Request>]
) -> Pin<Box<dyn Future<Output = Result<(), Self::SubmitError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn submit<'life0, 'life1, 'async_trait>( &'life0 self, reqs: &'life1 mut [SubmitRequest<Self::Request>] ) -> Pin<Box<dyn Future<Output = Result<(), Self::SubmitError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
The actual submit function. The driver should perform whatever device-specific submission procedure it needs to to submit all requests.