summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/response.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/response.rs b/src/response.rs
index fa1a294..68189fb 100644
--- a/src/response.rs
+++ b/src/response.rs
@@ -9,21 +9,24 @@ use tokio::{
io::{self, AsyncWrite, AsyncWriteExt},
};
-use strum::Display;
+use strum::{Display, EnumString, FromRepr};
use builder::Builder;
#[allow(unreachable_patterns)]
-#[derive(Debug, Clone, Copy, Display)]
+#[derive(Debug, Clone, Copy, Display, EnumString, FromRepr)]
pub enum Status {
- #[strum(to_string = "200 OK")]
- Ok,
+ #[strum(to_string = "200 OK", serialize = "OK")]
+ Ok = 200,
- #[strum(to_string = "404 Not Found")]
- NotFound,
+ #[strum(to_string = "404 Not Found", serialize = "Not Found")]
+ NotFound = 404,
- #[strum(to_string = "500 Internal Server Error")]
- InternalServerError,
+ #[strum(
+ to_string = "500 Internal Server Error",
+ serialize = "Internal ServerError"
+ )]
+ InternalServerError = 500,
}
#[derive(Debug)]