Trait oxide_auth::endpoint::QueryParameter[][src]

pub unsafe trait QueryParameter {
    fn unique_value(&self, key: &str) -> Option<Cow<'_, str>>;
fn normalize(&self) -> NormalizedParameter; }
Expand description

Allows access to the query parameters in an url or a body.

Use one of the listed implementations below. Since those may be a bit confusing due to their abundant use of generics, basically use any type of HashMap that maps ‘str-likes’ to a collection of other ‘str-likes’. Popular instances may be:

  • HashMap<String, String>
  • HashMap<String, Vec<String>>
  • HashMap<Cow<'static, str>, Cow<'static, str>>

You should generally not have to implement this trait yourself, and if you do there are additional requirements on your implementation to guarantee standard conformance. Therefore the trait is marked as unsafe.

Required methods

Get the unique value associated with a key.

If there are multiple values, return None. This is very important to guarantee conformance to the RFC. Afaik it prevents potentially subverting validation middleware, order dependent processing, or simple confusion between different components who parse the query string from different ends.

Guarantees that one can grab an owned copy.

Trait Implementations

Immutably borrows from an owned value. Read more

Immutably borrows from an owned value. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Implementations on Foreign Types

Implementors