pub struct PathParams { /* private fields */ }
Expand description
Container for extracted path parameters
Implementations§
Source§impl PathParams
impl PathParams
pub fn new() -> Self
pub fn add_param(&mut self, param: RouteParam)
Sourcepub fn get(&self, name: &str) -> Option<&RouteParam>
pub fn get(&self, name: &str) -> Option<&RouteParam>
Get a parameter by name
Sourcepub fn get_typed<T>(&self, name: &str) -> Result<T, ParamError>
pub fn get_typed<T>(&self, name: &str) -> Result<T, ParamError>
Get parameter value as typed value
Sourcepub fn all(&self) -> &HashMap<String, RouteParam>
pub fn all(&self) -> &HashMap<String, RouteParam>
Get all parameters
Sourcepub fn validate_all(&self) -> Result<(), ParamError>
pub fn validate_all(&self) -> Result<(), ParamError>
Validate all parameters
Trait Implementations§
Source§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
Auto Trait Implementations§
impl Freeze for PathParams
impl RefUnwindSafe for PathParams
impl Send for PathParams
impl Sync for PathParams
impl Unpin 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