Struct pencil::routing::Matcher [] [src]

pub struct Matcher {
    pub regex: Regex,
}

The matcher holds the url regex object.

Fields

regex

Methods

impl Matcher

fn new(regex: Regex) -> Matcher

Trait Implementations

impl<'a> From<&'a str> for Matcher

Rule strings basically are just normal URL paths with placeholders in the format <converter:name> where the converter are optional. Currently we support following converters:

If no converter is defined the default converter is used which means string.

URL rules that end with a slash are branch URLs, others are leaves.

fn from(rule: &'a str) -> Matcher

impl From<String> for Matcher

Same rule as &str.

fn from(rule: String) -> Matcher

impl From<Regex> for Matcher

fn from(regex: Regex) -> Matcher

Derived Implementations

impl Clone for Matcher

fn clone(&self) -> Matcher

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