MCPcopy Create free account
hub / github.com/aws/aws-lambda-rust-runtime / call

Method call

lambda-runtime-api-client/src/lib.rs:52–61  ·  view source on GitHub ↗

Send a given request to the Runtime API. Use the client's base URI to ensure the API endpoint is correct.

(&self, req: Request<body::Body>)

Source from the content-addressed store, hash-verified

50 /// Send a given request to the Runtime API.
51 /// Use the client's base URI to ensure the API endpoint is correct.
52 pub fn call(&self, req: Request<body::Body>) -> BoxFuture<'static, Result<Response<Incoming>, BoxError>> {
53 // NOTE: This method returns a boxed future such that the future has a static lifetime.
54 // Due to limitations around the Rust async implementation as of Mar 2024, this is
55 // required to minimize constraints on the handler passed to [lambda_runtime::run].
56 let req = match self.set_origin(req) {
57 Ok(req) => req,
58 Err(err) => return future::ready(Err(err)).boxed(),
59 };
60 self.client.request(req).map_err(Into::into).boxed()
61 }
62
63 /// Create a new client with a given base URI, HTTP connector, and optional pool size hint.
64 fn with(base: Uri, connector: HttpConnector, pool_size: Option<usize>) -> Self {

Callers

nothing calls this directly

Calls 2

set_originMethod · 0.80
boxedMethod · 0.80

Tested by

no test coverage detected