Skip to main content

sark_core/route/
reject.rs

1use sark_http::payload::response::status::Code;
2
3#[derive(Debug)]
4#[repr(u8)]
5pub enum Reject {
6    BadRequest,
7    Internal,
8    Unavailable,
9}
10
11impl Reject {
12    pub const fn status(self) -> Code {
13        match self {
14            Self::BadRequest => Code::BAD_REQUEST,
15            Self::Internal => Code::INTERNAL_SERVER_ERROR,
16            Self::Unavailable => Code::SERVICE_UNAVAILABLE,
17        }
18    }
19}