pub enum RouteSeg<'a> {
Name(RouteName<'a>),
Current,
Parent,
Empty,
}Expand description
๐ชช
One segment in a Route.
๐ data/access/route::RouteSeg
๐ฆ size_of::<RouteSeg>() == 12 bytes / 96 bits #๏ธโฃ #[cfg(target_pointer_width = โ32โ)]
โ๏ธOption<T> ๐ฐ T
๐ฆ size_of::<RouteSeg>() == 24 bytes / 192 bits #๏ธโฃ #[cfg(target_pointer_width = โ64โ)]
โ๏ธOption<T> ๐ฐ T
Special segments are preserved structurally. Normalization policy belongs
above this type, because filesystems, URLs, commands, and virtual routes do
not all treat ., .., empty segments, or trailing separators identically.
Variantsยง
Name(RouteName<'a>)
A named segment.
Current
The current context segment.
Parent
The parent context segment.
Empty
An empty segment.
Implementationsยง
Sourceยงimpl<'a> RouteSeg<'a>
impl<'a> RouteSeg<'a>
Sourcepub const fn name(self) -> Option<RouteName<'a>> โ
pub const fn name(self) -> Option<RouteName<'a>> โ
Returns the segment name, if this is a named segment.
Sourcepub const fn is_current(self) -> bool
pub const fn is_current(self) -> bool
Returns whether this is RouteSeg::Current.
Sourcepub const fn is_parent(self) -> bool
pub const fn is_parent(self) -> bool
Returns whether this is RouteSeg::Parent.
Sourcepub const fn is_empty(self) -> bool
pub const fn is_empty(self) -> bool
Returns whether this is RouteSeg::Empty.
Trait Implementationsยง
impl<'a> Copy for RouteSeg<'a>
impl<'a> Eq for RouteSeg<'a>
Sourceยงimpl<'a> Ord for RouteSeg<'a>
impl<'a> Ord for RouteSeg<'a>
1.21.0 (const: unstable) ยท Sourceยงfn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) ยท Sourceยงfn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงimpl<'a> PartialOrd for RouteSeg<'a>
impl<'a> PartialOrd for RouteSeg<'a>
impl<'a> StructuralPartialEq for RouteSeg<'a>
Auto Trait Implementationsยง
impl<'a> Freeze for RouteSeg<'a>
impl<'a> RefUnwindSafe for RouteSeg<'a>
impl<'a> Send for RouteSeg<'a>
impl<'a> Sync for RouteSeg<'a>
impl<'a> Unpin for RouteSeg<'a>
impl<'a> UnsafeUnpin for RouteSeg<'a>
impl<'a> UnwindSafe for RouteSeg<'a>
Blanket Implementationsยง
Sourceยงimpl<T> AnyExt for T
impl<T> AnyExt for T
Sourceยงfn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId of Self using a custom hasher.Sourceยงfn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Sourceยงfn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
alloc only.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
Sourceยงimpl<T> ByteSized for T
impl<T> ByteSized for T
Sourceยงconst BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Sourceยงfn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Sourceยงfn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Sourceยงconst NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Sourceยงfn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Sourceยงfn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Sourceยงfn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Sourceยงfn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Sourceยงfn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true if dropping values of this type matters. Read moreSourceยงfn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self without running its destructor. Read moreSourceยงfn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงunsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงunsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงfn mem_as_bytes(&self) -> &[u8] โ
fn mem_as_bytes(&self) -> &[u8] โ
unsafe_slice only.