pub trait RequestExt {
Show 16 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 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) -> Selfwhere 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) -> Selfwhere 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) -> Selfwhere 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 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

Implementations on Foreign Types§

source§

impl RequestExt for Parts

source§

fn raw_http_path(&self) -> &str

source§

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

source§

fn query_string_parameters(&self) -> QueryMap

source§

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

source§

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

source§

fn path_parameters(&self) -> QueryMap

source§

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

source§

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

source§

fn stage_variables(&self) -> QueryMap

source§

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

source§

fn request_context(&self) -> RequestContext

source§

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

source§

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

source§

fn lambda_context(&self) -> Context

source§

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

source§

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

source§

impl RequestExt for Extensions

source§

fn raw_http_path(&self) -> &str

source§

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

source§

fn query_string_parameters(&self) -> QueryMap

source§

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

source§

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

source§

fn path_parameters(&self) -> QueryMap

source§

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

source§

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

source§

fn stage_variables(&self) -> QueryMap

source§

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

source§

fn request_context(&self) -> RequestContext

source§

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

source§

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

source§

fn lambda_context(&self) -> Context

source§

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

source§

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

source§

impl<B> RequestExt for Request<B>

source§

fn raw_http_path(&self) -> &str

source§

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

source§

fn query_string_parameters(&self) -> QueryMap

source§

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

source§

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

source§

fn path_parameters(&self) -> QueryMap

source§

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

source§

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

source§

fn stage_variables(&self) -> QueryMap

source§

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

source§

fn request_context(&self) -> RequestContext

source§

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

source§

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

source§

fn lambda_context(&self) -> Context

source§

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

source§

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

Implementors§