use actix_web::App; pub trait ServiceBuilder { fn add_feature(self, f: F) -> App where F: Fn(App) -> App; } impl ServiceBuilder for App { fn add_feature(self, create_feature: F) -> App where F: Fn(App) -> App, { create_feature(self) } }