pub struct ParamsMap(/* private fields */);Expand description
A key-value map of the current named route params and their values.
Implementations§
Source§impl ParamsMap
impl ParamsMap
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates an empty map with the given capacity.
Sourcepub fn insert(&mut self, key: impl Into<Cow<'static, str>>, value: String)
pub fn insert(&mut self, key: impl Into<Cow<'static, str>>, value: String)
Inserts a value into the map.
If a value with that key already exists, the new value will be added to it.
To replace the value instead, see replace.
Sourcepub fn replace(&mut self, key: impl Into<Cow<'static, str>>, value: String)
pub fn replace(&mut self, key: impl Into<Cow<'static, str>>, value: String)
Inserts a value into the map, replacing any existing value for that key.
Sourcepub fn get(&self, key: &str) -> Option<String>
pub fn get(&self, key: &str) -> Option<String>
Gets the most-recently-added value of this param from the map.
Sourcepub fn get_all(&self, key: &str) -> Option<Vec<String>>
pub fn get_all(&self, key: &str) -> Option<Vec<String>>
Gets all references to a param of this name from the map.
Sourcepub fn latest_values(&self) -> ParamsMapIterRef<'_> ⓘ
pub fn latest_values(&self) -> ParamsMapIterRef<'_> ⓘ
Gets an iterator for all the most-recently-added values on the map
Sourcepub fn get_str(&self, key: &str) -> Option<&str>
pub fn get_str(&self, key: &str) -> Option<&str>
Gets a reference to the most-recently-added value of this param from the map.
Sourcepub fn to_query_string(&self) -> String
pub fn to_query_string(&self) -> String
Converts the map to a query string.
Trait Implementations§
impl Eq for ParamsMap
Source§impl<K, V> FromIterator<(K, V)> for ParamsMap
impl<K, V> FromIterator<(K, V)> for ParamsMap
Source§impl IntoIterator for ParamsMap
impl IntoIterator for ParamsMap
Source§impl<'a> IntoIterator for &'a ParamsMap
impl<'a> IntoIterator for &'a ParamsMap
impl StructuralPartialEq for ParamsMap
Auto Trait Implementations§
impl Freeze for ParamsMap
impl RefUnwindSafe for ParamsMap
impl Send for ParamsMap
impl Sync for ParamsMap
impl Unpin for ParamsMap
impl UnsafeUnpin for ParamsMap
impl UnwindSafe for ParamsMap
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<It, V> CollectView for Itwhere
It: IntoIterator<Item = V>,
V: IntoView,
impl<It, V> CollectView for Itwhere
It: IntoIterator<Item = V>,
V: IntoView,
Source§fn collect_view(self) -> Vec<<It as CollectView>::View>
fn collect_view(self) -> Vec<<It as CollectView>::View>
Collects the iterator into a list of views.
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.