pub trait QueryBuilder: Sized {
// Required method
fn add_query(&mut self, key: String, value: String);
// Provided methods
fn query(self, key: impl Into<String>, value: impl ToString) -> Self { ... }
fn query_opt(
self,
key: impl Into<String>,
value: Option<impl ToString>,
) -> Self { ... }
fn query_many<I, V>(self, key: impl Into<String>, values: I) -> Self
where I: IntoIterator<Item = V>,
V: ToString { ... }
fn query_many_opt<I, V>(
self,
key: impl Into<String>,
values: Option<I>,
) -> Self
where I: IntoIterator<Item = V>,
V: ToString { ... }
}Expand description
Query parameter builder
Required Methods§
Provided Methods§
Sourcefn query_opt(self, key: impl Into<String>, value: Option<impl ToString>) -> Self
fn query_opt(self, key: impl Into<String>, value: Option<impl ToString>) -> Self
Add optional query parameter (only if Some)
Sourcefn query_many<I, V>(self, key: impl Into<String>, values: I) -> Selfwhere
I: IntoIterator<Item = V>,
V: ToString,
fn query_many<I, V>(self, key: impl Into<String>, values: I) -> Selfwhere
I: IntoIterator<Item = V>,
V: ToString,
Add multiple query parameters with the same key
Sourcefn query_many_opt<I, V>(self, key: impl Into<String>, values: Option<I>) -> Selfwhere
I: IntoIterator<Item = V>,
V: ToString,
fn query_many_opt<I, V>(self, key: impl Into<String>, values: Option<I>) -> Selfwhere
I: IntoIterator<Item = V>,
V: ToString,
Add multiple optional query parameters with the same key
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.