pub struct Path {
pub matcher: Regex,
}
Expand description
Represents a path in HTTP sense (starting from /
)
Fields§
§matcher: Regex
Implementations§
Source§impl Path
impl Path
Sourcepub fn new(path: &str) -> Path
pub fn new(path: &str) -> Path
Creates a new path.
This method accepts regular expressions so you can write something like this:
use hyper_router::Path;
Path::new(r"/person/\d+");
Note that you don’t have to match beggining and end of the
path using ^
and $
- those are inserted for you automatically.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Path
impl !RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnwindSafe for Path
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> 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