Enum routefinder::Segment
source · pub enum Segment {
Slash,
Dot,
Exact(String),
Param(String),
Wildcard,
}
Expand description
the internal representation of a parsed component of a route
as an example, /hello/:planet/*
would be represented as the
following sequence [Exact("hello"), Slash, Param("planet"), Slash, Wildcard]
Variants§
Slash
represented by a / in the route spec and matching one /
Dot
represented by a . in the route spec and matching one . in the path
Exact(String)
represented by any free text in the route spec, this matches exactly that text
Param(String)
represented by :name, where name is how the capture will be
available in Captures
. Param captures up to the next slash
or dot, whichever is next in the spec.
Wildcard
represented by * in the spec, this will capture everything up
to the end of the path. a wildcard will also match nothing
(similar to the regex (.*)$
). There can only be one wildcard
per route spec
Trait Implementations§
source§impl Ord for Segment
impl Ord for Segment
source§impl PartialEq for Segment
impl PartialEq for Segment
source§impl PartialOrd for Segment
impl PartialOrd for Segment
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Segment
impl StructuralPartialEq for Segment
Auto Trait Implementations§
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnwindSafe for Segment
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