extern crate actix_web; use actix_web::middleware::{Middleware, Started}; use actix_web::{HttpRequest, Result}; pub struct SayHi; impl Middleware for SayHi { fn start(&self, _req: &mut HttpRequest) -> Result { println!("Hi"); Ok(Started::Done) } }