pub struct QueryView<'a> { /* private fields */ }Expand description
A parsed view over a request’s query string.
Borrowed from the request, so it cannot outlive it: the view hands out
&str into the request’s memoized pairs, never copies of them. The pairs
themselves are owned — percent-decoding has to produce new bytes — but they
are built once, on first access, not per lookup.
Implementations§
Source§impl<'a> QueryView<'a>
impl<'a> QueryView<'a>
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Whether key appears at all.
Sourcepub fn get_all(&self, key: &'a str) -> impl Iterator<Item = &'a str> + 'a
pub fn get_all(&self, key: &'a str) -> impl Iterator<Item = &'a str> + 'a
Every value for key, in the order the client sent them.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&'a str, &'a str)>
pub fn iter(&self) -> impl Iterator<Item = (&'a str, &'a str)>
Every pair, in the order the client sent them.
Sourcepub fn to_hash_map(&self) -> HashMap<String, String>
pub fn to_hash_map(&self) -> HashMap<String, String>
An owned copy, for the call sites that genuinely need one.
This is the allocation the lazy path exists to avoid — reach for it only
when a HashMap is actually required. Repeated keys collapse to the last
one, matching HashMap’s own insert semantics.
Trait Implementations§
impl<'a> Copy for QueryView<'a>
Auto Trait Implementations§
impl<'a> Freeze for QueryView<'a>
impl<'a> RefUnwindSafe for QueryView<'a>
impl<'a> Send for QueryView<'a>
impl<'a> Sync for QueryView<'a>
impl<'a> Unpin for QueryView<'a>
impl<'a> UnsafeUnpin for QueryView<'a>
impl<'a> UnwindSafe for QueryView<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<R, D> DepsPresent<D> for R
Source§impl<T> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging