Skip to main content

UseRouter

Trait UseRouter 

Source
pub trait UseRouter {
    // Required methods
    fn router(&self) -> &GlobalRouter;
    fn update_router<F, R>(&mut self, f: F) -> R
       where F: FnOnce(&mut GlobalRouter, &mut App) -> R;
}
Expand description

Trait for accessing the global router from context

Required Methods§

Source

fn router(&self) -> &GlobalRouter

Get reference to global router

Source

fn update_router<F, R>(&mut self, f: F) -> R
where F: FnOnce(&mut GlobalRouter, &mut App) -> R,

Update global router

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.

Implementations on Foreign Types§

Source§

impl UseRouter for App

Source§

fn router(&self) -> &GlobalRouter

Source§

fn update_router<F, R>(&mut self, f: F) -> R
where F: FnOnce(&mut GlobalRouter, &mut App) -> R,

Implementors§