pub struct RoutePath { /* private fields */ }Expand description
Carries a route path as the segments it matches.
Routers disagree about how a parameter is written, so a path held as a string is a path written for one framework. A path is read into segments once, here, and each interpreter spells those segments the way its own router reads them.
Implementations§
Source§impl RoutePath
impl RoutePath
Sourcepub fn parse(path: &str) -> Self
pub fn parse(path: &str) -> Self
Reads a path written in any of the spellings the major routers accept.
:name and {name} bind one segment, *name and {*name} bind every remaining segment,
and any other segment is matched literally. Empty segments state nothing, so leading,
trailing, and repeated separators are dropped.
Sourcepub fn segments(&self) -> &[PathSegment]
pub fn segments(&self) -> &[PathSegment]
Returns the segments this path matches, in order.
Trait Implementations§
impl Eq for RoutePath
impl StructuralPartialEq for RoutePath
Auto Trait Implementations§
impl Freeze for RoutePath
impl RefUnwindSafe for RoutePath
impl Send for RoutePath
impl Sync for RoutePath
impl Unpin for RoutePath
impl UnsafeUnpin for RoutePath
impl UnwindSafe for RoutePath
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<This> HttpProgramExt<This> for This
impl<This> HttpProgramExt<This> for This
Source§fn compile_http<Program>(
&self,
program: Program,
) -> <Program as HttpProgramAlg<This>>::Routewhere
Program: HttpProgramAlg<This>,
fn compile_http<Program>(
&self,
program: Program,
) -> <Program as HttpProgramAlg<This>>::Routewhere
Program: HttpProgramAlg<This>,
Compiles a named HTTP program with this interpreter.