pub struct Requester<T: RequestDriver> { /* private fields */ }
Expand description
A wrapper for managing requests and responses for a given driver.
Implementations§
source§impl<T: RequestDriver> Requester<T>
impl<T: RequestDriver> Requester<T>
sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Check if the requester is shutdown.
sourcepub async fn submit(
&self,
reqs: &mut [SubmitRequest<T::Request>],
) -> Result<InFlightFuture<T::Response>, SubmitError<T::SubmitError>>
pub async fn submit( &self, reqs: &mut [SubmitRequest<T::Request>], ) -> Result<InFlightFuture<T::Response>, SubmitError<T::SubmitError>>
Submit a set of requests, for which we are not interested in the specific responses from the device. Returns a future that awaits on an InFlightFuture, so awaiting on this function ensures that all requests are submitted, not necessarily handled.
sourcepub async fn submit_for_response(
&self,
reqs: &mut [SubmitRequest<T::Request>],
) -> Result<InFlightFutureWithResponses<T::Response>, SubmitError<T::SubmitError>>
pub async fn submit_for_response( &self, reqs: &mut [SubmitRequest<T::Request>], ) -> Result<InFlightFutureWithResponses<T::Response>, SubmitError<T::SubmitError>>
Submit a set of requests, for which we are interested in the specific responses from the device. Returns a future that awaits on an InFlightFutureWithResponses, so awaiting on this function ensures that all requests are submitted, not necessarily handled.
sourcepub fn finish(&self, resps: &[ResponseInfo<T::Response>])
pub fn finish(&self, resps: &[ResponseInfo<T::Response>])
Send back, from the driver, to the request manager, a set of responses to a previously submitted set of requests. The responses need not be contiguous in ID, nor do they need all be from the same set of requests.