#[non_exhaustive]pub enum SegmentType {
Static(&'static str),
Dynamic(&'static str),
CatchAll(&'static str),
Child,
}
Expand description
The type of a route segment.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Static(&'static str)
A static route segment.
Dynamic(&'static str)
A dynamic route segment.
CatchAll(&'static str)
A catch all route segment.
Child
A child router.
Implementations§
Source§impl SegmentType
impl SegmentType
Sourcepub fn to_static(&self) -> Option<&'static str>
pub fn to_static(&self) -> Option<&'static str>
Try to convert this segment into a static segment.
Sourcepub fn to_dynamic(&self) -> Option<&'static str>
pub fn to_dynamic(&self) -> Option<&'static str>
Try to convert this segment into a dynamic segment.
Sourcepub fn to_catch_all(&self) -> Option<&'static str>
pub fn to_catch_all(&self) -> Option<&'static str>
Try to convert this segment into a catch all segment.
Trait Implementations§
Source§impl Clone for SegmentType
impl Clone for SegmentType
Source§fn clone(&self) -> SegmentType
fn clone(&self) -> SegmentType
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SegmentType
impl Debug for SegmentType
Source§impl Display for SegmentType
impl Display for SegmentType
Source§impl PartialEq for SegmentType
impl PartialEq for SegmentType
impl StructuralPartialEq for SegmentType
Auto Trait Implementations§
impl Freeze for SegmentType
impl RefUnwindSafe for SegmentType
impl Send for SegmentType
impl Sync for SegmentType
impl Unpin for SegmentType
impl UnwindSafe for SegmentType
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<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.