1 2 3 4 5 6 7 8 9
use crate::{hteapot::HttpResponseCommon, utils::Context}; pub trait Handler { fn run(&self, context: &mut Context) -> Box<dyn HttpResponseCommon>; } pub trait HandlerFactory { fn is(context: &Context) -> Option<Box<dyn Handler>>; }