mirror of
https://github.com/actix/examples
synced 2024-12-03 18:22:14 +01:00
14 lines
293 B
Rust
14 lines
293 B
Rust
|
extern crate actix_web;
|
||
|
|
||
|
use actix_web::middleware::{Middleware, Started};
|
||
|
use actix_web::{HttpRequest, Result};
|
||
|
|
||
|
pub struct SayHi;
|
||
|
|
||
|
impl<S> Middleware<S> for SayHi {
|
||
|
fn start(&self, _req: &mut HttpRequest<S>) -> Result<Started> {
|
||
|
println!("Hi");
|
||
|
Ok(Started::Done)
|
||
|
}
|
||
|
}
|