Struct oauth1_request::request::parameter_list::ParameterList
source · [−]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
sourceimpl<K, V, A, P> ParameterList<K, V, A, P> where
K: AsRef<str>,
V: Display,
A: AsRef<[P]>,
P: Borrow<(K, V)>,
impl<K, V, A, P> ParameterList<K, V, A, P> where
K: AsRef<str>,
V: Display,
A: AsRef<[P]>,
P: Borrow<(K, V)>,
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.
sourceimpl<K, V, A, P> ParameterList<K, V, A, P> where
K: AsRef<str>,
V: Display,
A: AsRef<[P]> + AsMut<[P]>,
P: Borrow<(K, V)>,
impl<K, V, A, P> ParameterList<K, V, A, P> where
K: AsRef<str>,
V: Display,
A: AsRef<[P]> + AsMut<[P]>,
P: Borrow<(K, V)>,
sourceimpl<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
sourceimpl<K, V, A, P> Default for ParameterList<K, V, A, P> where
K: AsRef<str>,
V: Display,
A: AsRef<[P]> + Default,
P: Borrow<(K, V)>,
impl<K, V, A, P> Default for ParameterList<K, V, A, P> where
K: AsRef<str>,
V: Display,
A: AsRef<[P]> + Default,
P: Borrow<(K, V)>,
sourceimpl<K, V, A, P> Extend<P> for ParameterList<K, V, A, P> where
K: AsRef<str>,
V: Display,
A: AsMut<[P]> + Extend<P>,
P: Borrow<(K, V)>,
impl<K, V, A, P> Extend<P> for ParameterList<K, V, A, P> where
K: AsRef<str>,
V: Display,
A: AsMut<[P]> + Extend<P>,
P: Borrow<(K, V)>,
sourcefn 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
sourcefn 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.
sourcefn 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
sourceimpl<K, V, A, P> From<A> for ParameterList<K, V, A, P> where
K: AsRef<str>,
V: Display,
A: AsRef<[P]> + AsMut<[P]>,
P: Borrow<(K, V)>,
impl<K, V, A, P> From<A> for ParameterList<K, V, A, P> where
K: AsRef<str>,
V: Display,
A: AsRef<[P]> + AsMut<[P]>,
P: Borrow<(K, V)>,
sourceimpl<K, V, A, P> FromIterator<P> for ParameterList<K, V, A, P> where
K: AsRef<str>,
V: Display,
A: AsRef<[P]> + AsMut<[P]> + FromIterator<P>,
P: Borrow<(K, V)>,
impl<K, V, A, P> FromIterator<P> for ParameterList<K, V, A, P> where
K: AsRef<str>,
V: Display,
A: AsRef<[P]> + AsMut<[P]> + FromIterator<P>,
P: Borrow<(K, V)>,
sourcefn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = P>,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = P>,
Creates a value from an iterator. Read more
sourceimpl<K, V, A, P> Request for ParameterList<K, V, A, P> where
K: AsRef<str>,
V: Display,
A: AsRef<[P]>,
P: Borrow<(K, V)>,
impl<K, V, A, P> Request for ParameterList<K, V, A, P> where
K: AsRef<str>,
V: Display,
A: AsRef<[P]>,
P: Borrow<(K, V)>,
sourcefn serialize<S>(&self, serializer: S) -> S::Output where
S: Serializer,
fn serialize<S>(&self, serializer: S) -> S::Output where
S: Serializer,
Feeds a Serializer
implementation with the key-value pairs of the request
and returns the serializer’s output. Read more
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more