pub trait RequestExt {
Show 17 methods // Required methods fn raw_http_path(&self) -> &str; fn with_raw_http_path<S>(self, path: S) -> Self where S: Into<String>; fn query_string_parameters(&self) -> QueryMap; fn query_string_parameters_ref(&self) -> Option<&QueryMap>; fn with_query_string_parameters<Q>(self, parameters: Q) -> Self where Q: Into<QueryMap>; fn path_parameters(&self) -> QueryMap; fn path_parameters_ref(&self) -> Option<&QueryMap>; fn with_path_parameters<P>(self, parameters: P) -> Self where P: Into<QueryMap>; fn stage_variables(&self) -> QueryMap; fn stage_variables_ref(&self) -> Option<&QueryMap>; fn with_stage_variables<V>(self, variables: V) -> Self where V: Into<QueryMap>; fn request_context(&self) -> RequestContext; fn request_context_ref(&self) -> Option<&RequestContext>; fn with_request_context(self, context: RequestContext) -> Self; fn lambda_context(&self) -> Context; fn lambda_context_ref(&self) -> Option<&Context>; fn with_lambda_context(self, context: Context) -> Self;
}
Expand description

Extensions for lambda_http::Request, http::request::Parts, and http::Extensions structs that provide access to API gateway and ALB features.

Required Methods§

source

fn raw_http_path(&self) -> &str

Return the raw http path for a request without any stage information.

source

fn with_raw_http_path<S>(self, path: S) -> Self
where S: Into<String>,

Configures instance with the raw http path.

source

fn query_string_parameters(&self) -> QueryMap

Return pre-parsed HTTP query string parameters, parameters provided after the ? portion of a URL, associated with the API gateway request.

The yielded value represents both single and multi-valued parameters alike. When multiple query string parameters with the same name are expected, use query_string_parameters().all("many") to retrieve them all.

Having no query parameters will yield an empty QueryMap.

source

fn query_string_parameters_ref(&self) -> Option<&QueryMap>

Return pre-parsed HTTP query string parameters, parameters provided after the ? portion of a URL, associated with the API gateway request.

The yielded value represents both single and multi-valued parameters alike. When multiple query string parameters with the same name are expected, use query_string_parameters_ref().and_then(|params| params.all("many")) to retrieve them all.

Having no query parameters will yield None.

source

fn with_query_string_parameters<Q>(self, parameters: Q) -> Self
where Q: Into<QueryMap>,

Configures instance with query string parameters

This is intended for use in mock testing contexts.

source

fn path_parameters(&self) -> QueryMap

Return pre-extracted path parameters, parameter provided in URL placeholders /foo/{bar}/baz/{qux}, associated with the API gateway request. Having no path parameters will yield an empty QueryMap.

These will always be empty for ALB triggered requests.

source

fn path_parameters_ref(&self) -> Option<&QueryMap>

Return pre-extracted path parameters, parameter provided in URL placeholders /foo/{bar}/baz/{qux}, associated with the API gateway request. Having no path parameters will yield None.

These will always be None for ALB triggered requests.

source

fn with_path_parameters<P>(self, parameters: P) -> Self
where P: Into<QueryMap>,

Configures instance with path parameters

This is intended for use in mock testing contexts.

source

fn stage_variables(&self) -> QueryMap

Return stage variables associated with the API gateway request. Having no stage parameters will yield an empty QueryMap.

These will always be empty for ALB triggered requests.

source

fn stage_variables_ref(&self) -> Option<&QueryMap>

Return stage variables associated with the API gateway request. Having no stage parameters will yield None.

These will always be None for ALB triggered requests.

source

fn with_stage_variables<V>(self, variables: V) -> Self
where V: Into<QueryMap>,

Configures instance with stage variables

This is intended for use in mock testing contexts.

source

fn request_context(&self) -> RequestContext

Return request context data associated with the ALB or API gateway request

source

fn request_context_ref(&self) -> Option<&RequestContext>

Return a reference to the request context data associated with the ALB or API gateway request

source

fn with_request_context(self, context: RequestContext) -> Self

Configures instance with request context

This is intended for use in mock testing contexts.

source

fn lambda_context(&self) -> Context

Return Lambda function context data associated with the request

source

fn lambda_context_ref(&self) -> Option<&Context>

Return a reference to the Lambda function context data associated with the request

source

fn with_lambda_context(self, context: Context) -> Self

Configures instance with lambda context

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl RequestExt for Extensions

source§

impl RequestExt for Parts

source§

impl<B> RequestExt for Request<B>

Implementors§