[][src]Struct path_table::PathTable

pub struct PathTable<R> { /* fields omitted */ }

A generic path-based routing table, terminating with resources R.

Methods

impl<R> PathTable<R>
[src]

pub fn new() -> PathTable<R>
[src]

Create an empty routing table.

pub fn resource(&self) -> Option<&R>
[src]

Get the resource of current path.

pub fn resource_mut(&mut self) -> &mut Option<R>
[src]

Retrieve a mutable reference of the resource.

Important traits for Resources<'a, R>
pub fn iter(&self) -> Resources<R>
[src]

Return an iterator of all resources.

Important traits for ResourcesMut<'a, R>
pub fn iter_mut(&mut self) -> ResourcesMut<R>
[src]

Return a mutable iterator of all resources.

pub fn route<'a>(&'a self, path: &'a str) -> Option<(&'a R, RouteMatch<'a>)>
[src]

Determine which resource, if any, the concrete path should be routed to.

pub fn setup_table(&mut self, path: &str) -> &mut PathTable<R>
[src]

Return the table of the given routing path (which may contain wildcards).

If it doesn't already exist, this will make a new one.

impl<R: Default> PathTable<R>
[src]

pub fn setup(&mut self, path: &str) -> &mut R
[src]

Add or access a new resource at the given routing path (which may contain wildcards).

Trait Implementations

impl<R> Default for PathTable<R>
[src]

impl<R: Clone> Clone for PathTable<R>
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<R> Debug for PathTable<R>
[src]

Auto Trait Implementations

impl<R> Send for PathTable<R> where
    R: Send

impl<R> Sync for PathTable<R> where
    R: Sync

Blanket Implementations

impl<T> From for T
[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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