Skip to main content

APIHandler

Trait APIHandler 

Source
pub trait APIHandler {
    type State: Clone + Send + Sync + 'static;

    // Required methods
    fn generate_initial_state(&self) -> Self::State;
    fn generate_routes(&self) -> Router<Self::State>;
}

Required Associated Types§

Source

type State: Clone + Send + Sync + 'static

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: APIHandler> APIHandler for &T

Implementors§