1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use crate::{response::res::Response, request::req::Request};

pub struct Route{
    pub handler:   fn(Response, &Request) -> Response,
    pub path:      &'static str,
    pub method:    &'static str
}

impl Route{
    pub fn get_func(&self) 
    -> fn(Response, &Request) 
    -> Response{
        return self.handler;
    }

    pub fn get_path(&self) -> String{
        let path: String = String::from(self.path);
        
        return path;
    }

    pub fn get_method(&self) -> String{
        let method: String = String::from(self.method);

        return method;
    }
}