pub struct PathParams { /* private fields */ }Expand description
Path parameters extracted from the URL during route matching.
Stores up to 4 parameters on the stack without heap allocation. Uses linear search which outperforms HashMap for the small N typical of REST APIs (1-3 path parameters).
Implementations§
Source§impl PathParams
impl PathParams
pub fn new() -> Self
pub fn get(&self, key: &str) -> Option<&String>
pub fn insert(&mut self, key: String, value: String) -> Option<String>
pub fn remove(&mut self, key: &str) -> Option<String>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
pub fn iter(&self) -> impl Iterator<Item = (&str, &String)>
Trait Implementations§
Source§impl Clone for PathParams
impl Clone for PathParams
Source§fn clone(&self) -> PathParams
fn clone(&self) -> PathParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PathParams
impl Debug for PathParams
Source§impl Default for PathParams
impl Default for PathParams
Source§fn default() -> PathParams
fn default() -> PathParams
Returns the “default value” for a type. Read more
Source§impl FromIterator<(String, String)> for PathParams
impl FromIterator<(String, String)> for PathParams
Auto Trait Implementations§
impl Freeze for PathParams
impl RefUnwindSafe for PathParams
impl Send for PathParams
impl Sync for PathParams
impl Unpin for PathParams
impl UnsafeUnpin for PathParams
impl UnwindSafe for PathParams
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