pub struct RoutePattern { /* private fields */ }Expand description
A parsed route path such as /leads/{lead_id}/notes.
Implementations§
Source§impl RoutePattern
impl RoutePattern
Sourcepub fn parse(path: &str) -> Result<Self, RoutePathError>
pub fn parse(path: &str) -> Result<Self, RoutePathError>
Accepts {name} and the legacy :name; {*rest} only as the last
segment. / alone is the service root.
pub fn segments(&self) -> &[Segment]
Sourcepub fn params(&self) -> impl Iterator<Item = &str>
pub fn params(&self) -> impl Iterator<Item = &str>
Parameter names in path order, the catch-all included.
Sourcepub fn to_matchit(&self) -> String
pub fn to_matchit(&self) -> String
The pattern in matchit syntax: /leads/{lead_id}/close.
Sourcepub fn to_openapi(&self) -> String
pub fn to_openapi(&self) -> String
The pattern as an OpenAPI path template, the catch-all as {rest}.
Sourcepub fn first_literal(&self) -> Option<&str>
pub fn first_literal(&self) -> Option<&str>
The first segment when it is a literal.
Trait Implementations§
Source§impl Clone for RoutePattern
impl Clone for RoutePattern
Source§impl Debug for RoutePattern
impl Debug for RoutePattern
impl Eq for RoutePattern
Source§impl PartialEq for RoutePattern
impl PartialEq for RoutePattern
impl StructuralPartialEq for RoutePattern
Auto Trait Implementations§
impl Freeze for RoutePattern
impl RefUnwindSafe for RoutePattern
impl Send for RoutePattern
impl Sync for RoutePattern
impl Unpin for RoutePattern
impl UnsafeUnpin for RoutePattern
impl UnwindSafe for RoutePattern
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