[][src]Struct uri_pattern_matcher::UriPattern

pub struct UriPattern<'a> { /* fields omitted */ }

Struct used to parse strings as patterns - Check if an incoming string matches a pattern - Pattern Comparison

Implementations

impl<'_> UriPattern<'_>[src]

pub fn is_match(&self, candidate: &str) -> bool[src]

Method used to check if a candidate string matches against the pattern

Example

use uri_pattern_matcher::UriPattern;

let pattern: UriPattern = "/api/{resource}/{id}/details".into();
assert!(pattern.is_match("/api/resource/id1/details"));
assert!(pattern.is_match("/api/customer/John/details"));

Trait Implementations

impl<'a> Clone for UriPattern<'a>[src]

impl<'a> Debug for UriPattern<'a>[src]

impl<'a> From<&'a str> for UriPattern<'a>[src]

impl<'_> PartialEq<UriPattern<'_>> for UriPattern<'_>[src]

impl<'_> PartialOrd<UriPattern<'_>> for UriPattern<'_>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for UriPattern<'a>[src]

impl<'a> Send for UriPattern<'a>[src]

impl<'a> Sync for UriPattern<'a>[src]

impl<'a> Unpin for UriPattern<'a>[src]

impl<'a> UnwindSafe for UriPattern<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.