pub trait QueryString {
// Required method
fn query_string(&self) -> String;
}Expand description
Provides a way of converting a request struct (such as
crate::directions::Request or crate::elevation::Request) to a
URL
query string that
can be used in an HTTP
GET request.
Required Methods§
Sourcefn query_string(&self) -> String
fn query_string(&self) -> String
Converts a request struct (presumably a request type such as
crate::directions::Request) to a
URL
query string that
can be used in an HTTP
GET
request.
§Notes
-
This function does not validate the request before generating the query string. However, the superior method that generates the query URL does perform validation.
-
The query string is the part of the URL after the
?question mark. For example, in the URLhttps://example.com/over/there?name=ferretthe query string isname=ferret -
There’s no benefit to working on an owned
Requeststruct (i.e. an ownedselfversus an borrowed&self). percent-encoding works on borrowed UTF-8 strings. Other types, such as enums and numeric values are converted into strings. Therefore no zero-copy operations are possible with an ownedself.
Implementors§
impl QueryString for &google_maps::places_new::autocomplete::RequestWithClient<'_>
reqwest only.impl QueryString for &google_maps::places_new::nearby_search::RequestWithClient<'_>
reqwest only.impl QueryString for &google_maps::places_new::place_details::Request<'_>
reqwest only.impl QueryString for &google_maps::places_new::place_photos::ImageRequest<'_>
reqwest only.impl QueryString for &google_maps::places_new::place_photos::UriRequest<'_>
reqwest only.impl QueryString for &google_maps::places_new::text_search::RequestWithClient<'_>
reqwest only.