1
2
3
4
5
6
7
8
9
10
11
12
13
use trillium::{async_trait, Conn, Handler};

/// a struct that halts the Conn handler sequence. see [`Conn::halt`]
/// for more.
#[derive(Clone, Copy, Debug)]
pub struct Halt;

#[async_trait]
impl Handler for Halt {
    async fn run(&self, conn: Conn) -> Conn {
        conn.halt()
    }
}