mas_router

Trait Route

Source
pub trait Route {
    type Query: Serialize;

    // Required method
    fn route() -> &'static str;

    // Provided methods
    fn query(&self) -> Option<&Self::Query> { ... }
    fn path(&self) -> Cow<'static, str> { ... }
    fn path_and_query(&self) -> Cow<'static, str> { ... }
    fn absolute_url(&self, base: &Url) -> Url { ... }
}

Required Associated Types§

Required Methods§

Source

fn route() -> &'static str

Provided Methods§

Source

fn query(&self) -> Option<&Self::Query>

Source

fn path(&self) -> Cow<'static, str>

Source

fn path_and_query(&self) -> Cow<'static, str>

Source

fn absolute_url(&self, base: &Url) -> Url

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§