I dunno
This commit is contained in:
parent
943ff8eb45
commit
e209abe7a0
2 changed files with 36 additions and 2 deletions
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue