pub struct InFlightRequest<Req, Res> { /* private fields */ }Expand description
A request produced by Channel::requests.
If dropped without calling execute, a cancellation message will
be sent to the Channel to clean up associated request state.
Implementations§
Source§impl<Req, Res> InFlightRequest<Req, Res>
impl<Req, Res> InFlightRequest<Req, Res>
Sourcepub async fn execute<S>(self, serve: S)where
S: Serve<Req, Resp = Res>,
pub async fn execute<S>(self, serve: S)where
S: Serve<Req, Resp = Res>,
Returns a future that executes the request using the given service function. The service function’s output is automatically sent back to the Channel that yielded this request. The request will be executed in the scope of this request’s context.
The returned future will stop executing when the first of the following conditions is met:
- The channel that yielded this request receives a cancellation message for this request.
- The request deadline is reached.
- The service function completes.
If the returned Future is dropped before completion, a cancellation message will be sent to the Channel to clean up associated request state.
Trait Implementations§
Auto Trait Implementations§
impl<Req, Res> Freeze for InFlightRequest<Req, Res>where
Req: Freeze,
impl<Req, Res> !RefUnwindSafe for InFlightRequest<Req, Res>
impl<Req, Res> Send for InFlightRequest<Req, Res>
impl<Req, Res> Sync for InFlightRequest<Req, Res>
impl<Req, Res> Unpin for InFlightRequest<Req, Res>where
Req: Unpin,
impl<Req, Res> !UnwindSafe for InFlightRequest<Req, Res>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more