use { super::*, brotli::enc::backward_references::BrotliEncoderMode::{ self, BROTLI_MODE_FONT, BROTLI_MODE_GENERIC, BROTLI_MODE_TEXT, }, mp4::{MediaType, Mp4Reader, TrackType}, std::{fs::File, io::BufReader}, }; #[derive(Debug, PartialEq, Copy, Clone)] pub(crate) enum Media { Audio, Code(Language), Font, Iframe, Image, Markdown, Model, Pdf, Text, Unknown, Video, } #[derive(Debug, PartialEq, Copy, Clone)] pub(crate) enum Language { Css, JavaScript, Json, Python, Yaml, } impl Display for Language { fn fmt(&self, f: &mut Formatter) -> fmt::Result { write!( f, "{}", match self { Self::Css => "css", Self::JavaScript => "javascript", Self::Json => "json", Self::Python => "python", Self::Yaml => "yaml", } ) } } impl Media { #[rustfmt::skip] const TABLE: &'static [(&'static str, BrotliEncoderMode, Media, &'static [&'static str])] = &[ ("application/cbor", BROTLI_MODE_GENERIC, Media::Unknown, &["cbor"]),