yew_router_route_parser::parser

Enum RefCaptureVariant

Source
pub enum RefCaptureVariant<'a> {
    Unnamed,
    ManyUnnamed,
    NumberedUnnamed {
        sections: usize,
    },
    Named(&'a str),
    ManyNamed(&'a str),
    NumberedNamed {
        sections: usize,
        name: &'a str,
    },
}
Expand description

Token representing various types of captures.

It can capture and discard for unnamed variants, or capture and store in the Matches for the named variants.

Its name stems from the fact that it does not have ownership over all its values. It gets converted to CaptureVariant, a nearly identical enum that has owned Strings instead.

Variants§

§

Unnamed

{}

§

ManyUnnamed

{*}

§

NumberedUnnamed

{5}

Fields

§sections: usize

Number of sections to match.

§

Named(&'a str)

{name} - captures a section and adds it to the map with a given name.

§

ManyNamed(&'a str)

{*:name} - captures over many sections and adds it to the map with a given name.

§

NumberedNamed

{2:name} - captures a fixed number of sections with a given name.

Fields

§sections: usize

Number of sections to match.

§name: &'a str

The key to be entered in the Matches map.

Trait Implementations§

Source§

impl<'a> Clone for RefCaptureVariant<'a>

Source§

fn clone(&self) -> RefCaptureVariant<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for RefCaptureVariant<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> From<RefCaptureVariant<'a>> for CaptureVariant

Source§

fn from(v: RefCaptureVariant<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> PartialEq for RefCaptureVariant<'a>

Source§

fn eq(&self, other: &RefCaptureVariant<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Copy for RefCaptureVariant<'a>

Source§

impl<'a> StructuralPartialEq for RefCaptureVariant<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for RefCaptureVariant<'a>

§

impl<'a> RefUnwindSafe for RefCaptureVariant<'a>

§

impl<'a> Send for RefCaptureVariant<'a>

§

impl<'a> Sync for RefCaptureVariant<'a>

§

impl<'a> Unpin for RefCaptureVariant<'a>

§

impl<'a> UnwindSafe for RefCaptureVariant<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.