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
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 more