This commit is contained in:
maxstrb 2025-10-06 22:27:10 +02:00
parent 943ff8eb45
commit e209abe7a0
2 changed files with 36 additions and 2 deletions

View file

@ -1,14 +1,30 @@
use std::{io, str::FromStr};
pub enum ContentType {
Text(TextType),
Aplication(ApplicationType),
Any,
}
impl FromStr for ContentType {
type Err = io::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Err(io::Error::new(
io::ErrorKind::InvalidData,
"Invalid content-type",
))
}
}
pub enum TextType {
Html,
Css,
Javascript,
Any,
}
pub enum ApplicationType {
Json,
Any,
}