pub struct ParameterExtractor { /* private fields */ }
Expand description
Parameter extractor for route patterns
Implementations§
Source§impl ParameterExtractor
impl ParameterExtractor
Sourcepub fn new(pattern: RoutePattern) -> Self
pub fn new(pattern: RoutePattern) -> Self
Create a new parameter extractor for a route pattern
Sourcepub fn extract_from_params(
&self,
raw_params: HashMap<String, String>,
) -> Result<ExtractedParams, ExtractionError>
pub fn extract_from_params( &self, raw_params: HashMap<String, String>, ) -> Result<ExtractedParams, ExtractionError>
Extract and validate parameters from raw parameters (efficient - no re-matching)
Sourcepub fn extract(&self, path: &str) -> Result<ExtractedParams, ExtractionError>
pub fn extract(&self, path: &str) -> Result<ExtractedParams, ExtractionError>
Extract parameters from a path that matches this pattern (legacy method - less efficient)
Note: This method performs pattern matching and parameter extraction. For better performance, use extract_from_params() when raw parameters are already available.
Sourcepub fn pattern(&self) -> &RoutePattern
pub fn pattern(&self) -> &RoutePattern
Get the route pattern
Sourcepub fn param_names(&self) -> &[String]
pub fn param_names(&self) -> &[String]
Get expected parameter names
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParameterExtractor
impl RefUnwindSafe for ParameterExtractor
impl Send for ParameterExtractor
impl Sync for ParameterExtractor
impl Unpin for ParameterExtractor
impl UnwindSafe for ParameterExtractor
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