Middleware for Rust