Struct rocket::request::Query[][src]

pub struct Query<'q>(_);

Iterator over form items in a query string.

The Query type exists to separate, at the type level, form form items (FormItems) from query form items (Query). A value of type Query is passed in to implementations of the FromQuery trait by Rocket's code generation for every trailing query parameter, <params..> below:

#[get("/user?<params..>")]
fn user(params: T) { /* ... */ }

Usage

A value of type Query can only be used as an iterator over values of type FormItem. As such, its usage is equivalent to that of FormItems, and we refer you to its documentation for further details.

Example

use rocket::request::Query;

fn from_query(query: Query) -> Result {
    for item in query {
        println!("query key/value: ({}, {})", item.key, item.value);
    }

    // ...
}

Trait Implementations

impl<'q> Clone for Query<'q>[src]

impl<'q> Debug for Query<'q>[src]

impl<'q> Iterator for Query<'q>[src]

type Item = FormItem<'q>

The type of the elements being iterated over.

Auto Trait Implementations

impl<'q> RefUnwindSafe for Query<'q>[src]

impl<'q> Send for Query<'q>[src]

impl<'q> Sync for Query<'q>[src]

impl<'q> Unpin for Query<'q>[src]

impl<'q> UnwindSafe for Query<'q>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, I> AsResult<T, I> for T where
    I: Input, 

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoCollection<T> for T

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<I> IteratorRandom for I where
    I: Iterator
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,