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§
Source§impl<K, V, A, P> ParameterList<K, V, A, P>
impl<K, V, A, P> ParameterList<K, V, A, P>
Sourcepub fn from_sorted(list: A) -> Option<Self>
pub fn from_sorted(list: A) -> Option<Self>
Creates a new ParameterList
from sorted list
.
Returns None
if list
is not sorted.
Source§impl<K, V, A, P> ParameterList<K, V, A, P>
impl<K, V, A, P> ParameterList<K, V, A, P>
Source§impl<K, V, A, P> ParameterList<K, V, A, P>
impl<K, V, A, P> ParameterList<K, V, A, P>
Sourcepub fn into_inner(self) -> A
pub fn into_inner(self) -> A
Consumes the ParameterList
, returning the wrapped value.
Trait Implementations§
Source§impl<K, V, A, P> AsRef<[P]> for ParameterList<K, V, A, P>
impl<K, V, A, P> AsRef<[P]> for ParameterList<K, V, A, P>
Source§impl<K, V, A, P> Default for ParameterList<K, V, A, P>
impl<K, V, A, P> Default for ParameterList<K, V, A, P>
Source§impl<K, V, A, P> Extend<P> for ParameterList<K, V, A, P>
impl<K, V, A, P> Extend<P> for ParameterList<K, V, A, P>
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = P>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = P>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<K, V, A, P> From<A> for ParameterList<K, V, A, P>
impl<K, V, A, P> From<A> for ParameterList<K, V, A, P>
Source§impl<K, V, A, P> FromIterator<P> for ParameterList<K, V, A, P>
impl<K, V, A, P> FromIterator<P> for ParameterList<K, V, A, P>
Source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = P>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = P>,
Creates a value from an iterator. Read more
Source§impl<K, V, A, P> Request for ParameterList<K, V, A, P>
impl<K, V, A, P> Request for ParameterList<K, V, A, P>
Source§fn serialize<S>(&self, serializer: S) -> S::Outputwhere
S: Serializer,
fn serialize<S>(&self, serializer: S) -> S::Outputwhere
S: Serializer,
Feeds a
Serializer
implementation with the key-value pairs of the request
and returns the serializer’s output.Auto Trait Implementations§
impl<K, V, A, P> Freeze for ParameterList<K, V, A, P>where
A: Freeze,
impl<K, V, A, P> RefUnwindSafe for ParameterList<K, V, A, P>where
A: RefUnwindSafe,
impl<K, V, A, P> Send for ParameterList<K, V, A, P>where
A: Send,
impl<K, V, A, P> Sync for ParameterList<K, V, A, P>where
A: Sync,
impl<K, V, A, P> Unpin for ParameterList<K, V, A, P>where
A: Unpin,
impl<K, V, A, P> UnwindSafe for ParameterList<K, V, A, P>where
A: UnwindSafe,
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