axum-rh 0.2.8

A helper library for the axum router
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use axum::routing::MethodRouter;

#[derive(Clone, Debug)]
pub struct Endpoint<T> {
    pub path: &'static str,
    pub authenticated: bool,
    pub handler: MethodRouter<T>,
}

impl<T> Endpoint<T> {
    pub fn new(path: &'static str, authenticated: bool, handler: MethodRouter<T>) -> Self {
        Self {
            path,
            authenticated,
            handler,
        }
    }
}