pub struct LeadingSlash<T>(pub T);
Expand description
Wrapper that requires that an implementor of Switch must start with a /
.
This is needed for any non-derived type provided by yew-router to be used by itself.
This is because route strings will almost always start with /
, so in order to get a std type
with the rest
attribute, without a specified leading /
, this wrapper is needed.
Tuple Fields§
§0: T
Trait Implementations§
Source§impl<T: Clone> Clone for LeadingSlash<T>
impl<T: Clone> Clone for LeadingSlash<T>
Source§fn clone(&self) -> LeadingSlash<T>
fn clone(&self) -> LeadingSlash<T>
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<T: Debug> Debug for LeadingSlash<T>
impl<T: Debug> Debug for LeadingSlash<T>
Source§impl<T: Hash> Hash for LeadingSlash<T>
impl<T: Hash> Hash for LeadingSlash<T>
Source§impl<T: Ord> Ord for LeadingSlash<T>
impl<T: Ord> Ord for LeadingSlash<T>
Source§fn cmp(&self, other: &LeadingSlash<T>) -> Ordering
fn cmp(&self, other: &LeadingSlash<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for LeadingSlash<T>
impl<T: PartialEq> PartialEq for LeadingSlash<T>
Source§impl<T: PartialOrd> PartialOrd for LeadingSlash<T>
impl<T: PartialOrd> PartialOrd for LeadingSlash<T>
Source§impl<U: Switch> Switch for LeadingSlash<U>
impl<U: Switch> Switch for LeadingSlash<U>
Source§fn from_route_part<STATE>(
part: String,
state: Option<STATE>,
) -> (Option<Self>, Option<STATE>)
fn from_route_part<STATE>( part: String, state: Option<STATE>, ) -> (Option<Self>, Option<STATE>)
Get self from a part of the state
Source§fn build_route_section<T>(self, route: &mut String) -> Option<T>
fn build_route_section<T>(self, route: &mut String) -> Option<T>
Build part of a route from itself.
Source§fn switch<STATE>(route: Route<STATE>) -> Option<Self>
fn switch<STATE>(route: Route<STATE>) -> Option<Self>
Based on a route, possibly produce an itself.
Source§fn key_not_available() -> Option<Self>
fn key_not_available() -> Option<Self>
Called when the key (the named capture group) can’t be located. Instead of failing outright,
a default item can be provided instead. Read more
impl<T: Copy> Copy for LeadingSlash<T>
impl<T: Eq> Eq for LeadingSlash<T>
impl<T> StructuralPartialEq for LeadingSlash<T>
Auto Trait Implementations§
impl<T> Freeze for LeadingSlash<T>where
T: Freeze,
impl<T> RefUnwindSafe for LeadingSlash<T>where
T: RefUnwindSafe,
impl<T> Send for LeadingSlash<T>where
T: Send,
impl<T> Sync for LeadingSlash<T>where
T: Sync,
impl<T> Unpin for LeadingSlash<T>where
T: Unpin,
impl<T> UnwindSafe for LeadingSlash<T>where
T: UnwindSafe,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self
to a value of a Properties
struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self
to a value of a Properties
struct.