Enum sycamore_router::Capture
source · [−]Expand description
Represents a capture of an URL segment or segments.
Variants
DynParam(&'a str)
A dynamic parameter in the URL (i.e. matches a single url segment).
DynSegments(Vec<&'a str>)
A dynamic segment in the URL (i.e. matches multiple url segments).
Implementations
sourceimpl<'a> Capture<'a>
impl<'a> Capture<'a>
sourcepub fn as_dyn_param(&self) -> Option<&'a str>
pub fn as_dyn_param(&self) -> Option<&'a str>
Attempts to cast the Capture
to a Capture::DynParam
with the matched url param.
sourcepub fn as_dyn_segments(&self) -> Option<&[&'a str]>
pub fn as_dyn_segments(&self) -> Option<&[&'a str]>
Attempts to cast the Capture
to a Capture::DynSegments
with the matched url params.
Trait Implementations
sourceimpl<'a> PartialEq<Capture<'a>> for Capture<'a>
impl<'a> PartialEq<Capture<'a>> for Capture<'a>
impl<'a> Eq for Capture<'a>
impl<'a> StructuralEq for Capture<'a>
impl<'a> StructuralPartialEq for Capture<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for Capture<'a>
impl<'a> Send for Capture<'a>
impl<'a> Sync for Capture<'a>
impl<'a> Unpin for Capture<'a>
impl<'a> UnwindSafe for Capture<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.