Add further impl for mainloop

This commit is contained in:
2026-08-20 00:47:52 +08:00
parent 137028ac03
commit eaf76dfe29
5 changed files with 102 additions and 64 deletions
+13 -7
View File
@@ -1,10 +1,10 @@
use std::str::FromStr;
#[derive(Debug)]
pub(crate) struct ReqLine {
pub(crate) method: String,
pub(crate) route: String,
pub(crate) version: String,
pub struct ReqLine {
pub method: String,
pub route: String,
pub version: String,
}
impl FromStr for ReqLine {
@@ -26,9 +26,9 @@ impl FromStr for ReqLine {
}
#[derive(Debug)]
pub(crate) struct Header {
pub(crate) key: String,
pub(crate) value: String,
pub struct Header {
pub key: String,
pub value: String,
}
impl FromStr for Header {
@@ -44,3 +44,9 @@ impl FromStr for Header {
})
}
}
#[derive(Debug)]
pub struct Request {
pub req_line: ReqLine,
pub headers: Vec<Header>,
}