You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lambda_http: Add convenience methods to get references to data in the request (#602)
* Fixed some types in docs and tests
* Add convenience methods to get references to data in the request
There are existing methods to get owned clones of various pieces of data
in the `Request`. This adds methods to get references where owned data
is not needed.
Copy file name to clipboardExpand all lines: lambda-http/src/ext.rs
+99-24Lines changed: 99 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ impl Error for PayloadError {
55
55
}
56
56
}
57
57
58
-
/// Extentions for `lambda_http::Request` structs that
58
+
/// Extensions for `lambda_http::Request` structs that
59
59
/// provide access to [API gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-input-format)
60
60
/// and [ALB](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/lambda-functions.html)
61
61
/// features.
@@ -109,6 +109,9 @@ pub trait RequestExt {
109
109
/// Return the raw http path for a request without any stage information.
110
110
fnraw_http_path(&self) -> String;
111
111
112
+
/// Return the raw http path for a request without any stage information.
113
+
fnraw_http_path_str(&self) -> &str;
114
+
112
115
/// Configures instance with the raw http path.
113
116
fnwith_raw_http_path(self,path:&str) -> Self;
114
117
@@ -118,12 +121,24 @@ pub trait RequestExt {
118
121
///
119
122
/// The yielded value represents both single and multi-valued
120
123
/// parameters alike. When multiple query string parameters with the same
121
-
/// name are expected, `query_string_parameters().get_all("many")` to retrieve them all.
124
+
/// name are expected, `query_string_parameters().all("many")` to retrieve them all.
122
125
///
123
-
/// No query parameters
124
-
/// will yield an empty `QueryMap`.
126
+
/// No query parameters will yield an empty `QueryMap`.
0 commit comments