use crate::collection::ShortStrU8;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum Mime {
ApplicationGrpc,
ApplicationJson,
ApplicationOctetStream,
ApplicationPdf,
ApplicationVndGoogleProtobuf,
ApplicationWasm,
ApplicationXml,
ApplicationXWwwFormUrlEncoded,
ApplicationYaml,
ApplicationZip,
AudioMpeg,
AudioOgg,
AudioWebm,
Custom(ShortStrU8<'static>),
FontWoff,
FontWoff2,
ImageAvif,
ImageGif,
ImageJpeg,
ImagePng,
ImageSvgXml,
ImageWebp,
ImageXIcon,
MultipartFormData,
TextCss,
TextCsv,
TextHtml,
TextJavascript,
TextMarkdown,
TextPlain,
VideoMp4,
VideoMpeg,
VideoWebm,
}
impl Mime {
#[inline]
pub fn as_str(&self) -> &'static str {
match self {
Self::ApplicationGrpc => "application/grpc",
Self::ApplicationJson => "application/json",
Self::ApplicationOctetStream => "application/octet-stream",
Self::ApplicationPdf => "application/pdf",
Self::ApplicationVndGoogleProtobuf => "application/vnd.google.protobuf",
Self::ApplicationWasm => "application/wasm",
Self::ApplicationXml => "application/xml",
Self::ApplicationXWwwFormUrlEncoded => "application/x-www-form-urlencoded",
Self::ApplicationYaml => "application/yaml",
Self::ApplicationZip => "application/zip",
Self::AudioMpeg => "audio/mpeg",
Self::AudioOgg => "audio/ogg",
Self::AudioWebm => "audio/webm",
Self::Custom(el) => el.into_str(),
Self::FontWoff => "font/woff",
Self::FontWoff2 => "font/woff2",
Self::ImageAvif => "image/avif",
Self::ImageGif => "image/gif",
Self::ImageJpeg => "image/jpeg",
Self::ImagePng => "image/png",
Self::ImageSvgXml => "image/svg+xml",
Self::ImageWebp => "image/webp",
Self::ImageXIcon => "image/x-icon",
Self::MultipartFormData => "multipart/form-data",
Self::TextCss => "text/css",
Self::TextCsv => "text/csv",
Self::TextHtml => "text/html",
Self::TextJavascript => "text/javascript",
Self::TextMarkdown => "text/markdown",
Self::TextPlain => "text/plain",
Self::VideoMp4 => "video/mp4",
Self::VideoMpeg => "video/mpeg",
Self::VideoWebm => "video/webm",
}
}
}