pub struct ParameterList<K, V, A = Vec<(K, V)>, P = (K, V)> { /* private fields */ }
Expand description

A Request with dynamic list of key-value parameter pairs.

This is like an array of (K, V) but the parameters are guaranteed to be sorted alphabetically.

Example

let request = oauth::ParameterList::new([
   ("foo", 123),
   ("bar", 23),
   ("foo", 3),
]);

let form = oauth::to_form(&request);
assert_eq!(form, "bar=23&foo=123&foo=3");

Implementations

Creates a new ParameterList from sorted list.

Returns None if list is not sorted.

Creates a new ParameterList from list.

This function sorts list.

Consumes the ParameterList, returning the wrapped value.

Returns an iterator over entries of the ParameterList.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Returns the “default value” for a type. Read more

Extends a collection with the contents of an iterator. Read more

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

Extends a collection with exactly one element.

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

Reserves capacity in a collection for the given number of additional elements. Read more

Converts to this type from the input type.

Creates a value from an iterator. Read more

Feeds a Serializer implementation with the key-value pairs of the request and returns the serializer’s output. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.