pub fn sniff(bytes: &[u8]) -> crate::Result<Self> {
        let info = Infer::new();
        let mime = match info.get(&bytes) {
            Some(info) => info.mime,
            None => crate::bail!("Could not sniff the mime type"),
        };

        Ok(Self {
            essence: mime,
            static_essence: None,
            basetype: String::new(), // TODO: fill in.
            subtype: String::new(),  // TODO: fill in.
            static_basetype: None,   // TODO: fill in
            static_subtype: None,
            params: None, // TODO: fill in.
        })
    }
/// Sniff the mime type from a byte slice.
Sniff the mime type from a byte slice.
Sniff the mime type from a byte slice .
pub fn sniff(bytes: &[u8]) -> crate::Result<Self> {
        let info = Infer::new();
        let mime = match info.get(&bytes) {
            Some(info) => info.mime,
            None => crate::bail!("Could not sniff the mime type"),
        };
        Ok(Self {
            essence: mime,
            static_essence: None,
            basetype: String::new(), // TODO: fill in.
            subtype: String::new(),  // TODO: fill in.
            static_basetype: None,   // TODO: fill in
            static_subtype: None,
            params: None, // TODO: fill in.
        })
    }
pub fn sniff ( bytes : & [ u8 ] ) -> crate :: Result < Self > { let info = Infer :: new ( ) ; let mime = match info . get ( & bytes ) { Some ( info ) => info . mime , None => crate :: bail ! ( " " ) , } ; Ok ( Self { essence : mime , static_essence : None , basetype : String :: new ( ) , // TODO: fill in. subtype : String :: new ( ) , // TODO: fill in. static_basetype : None , // TODO: fill in static_subtype : None , params : None , // TODO: fill in. } ) }
Sniff the mime type from a byte slice.
Sniff the mime type from a byte slice .
bytes
&[u8]
bytes
&[u8]