pub struct Query { /* private fields */ }Expand description
Query parameters from URL (also used for application/x-www-form-urlencoded bodies)
Implementations§
Source§impl Query
impl Query
pub fn new() -> Self
Sourcepub fn parse_query_string(query: &str) -> Self
pub fn parse_query_string(query: &str) -> Self
Parse a=1&b=two. Keys and values are percent-decoded and + is a
space. Pairs without = are kept with an empty value; if a key repeats,
the last value wins.
pub fn get(&self, key: &str) -> Option<&str>
pub fn contains(&self, key: &str) -> bool
pub fn is_empty(&self) -> bool
Sourcepub fn parse<T: DeserializeOwned>(&self) -> Result<T>
pub fn parse<T: DeserializeOwned>(&self) -> Result<T>
Deserialize into a struct; numbers, booleans and Option are converted
from their string form.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin for Query
impl UnwindSafe for Query
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more