MCPcopy Index your code
hub / github.com/aws/aws-lambda-rust-runtime / poll

Method poll

lambda-http/src/lib.rs:131–146  ·  view source on GitHub ↗
(mut self: Pin<&mut Self>, cx: &mut TaskContext<'_>)

Source from the content-addressed store, hash-verified

129 type Output = Result<LambdaResponse, E>;
130
131 fn poll(mut self: Pin<&mut Self>, cx: &mut TaskContext<'_>) -> Poll<Self::Output> {
132 match *self {
133 TransformResponse::Request(ref mut origin, ref mut request) => match request.as_mut().poll(cx) {
134 Poll::Ready(Ok(resp)) => {
135 *self = TransformResponse::Response(origin.clone(), resp.into_response());
136 self.poll(cx)
137 }
138 Poll::Ready(Err(err)) => Poll::Ready(Err(err)),
139 Poll::Pending => Poll::Pending,
140 },
141 TransformResponse::Response(ref mut origin, ref mut response) => match response.as_mut().poll(cx) {
142 Poll::Ready(resp) => Poll::Ready(Ok(LambdaResponse::from_response(origin, resp))),
143 Poll::Pending => Poll::Pending,
144 },
145 }
146 }
147}
148
149/// Wraps a `Service<Request>` in a `Service<LambdaEvent<Request>>`

Callers

nothing calls this directly

Calls 3

ResponseClass · 0.50
cloneMethod · 0.45
into_responseMethod · 0.45

Tested by

no test coverage detected