pub fn file(&self, filename: &str) -> Result<String, MagicError> {
        let f = CString::new(filename).map_err(|e| MagicError {
            desc: format!("{:?}", e),
        })?;
        let cf = f.as_ptr();
        let s = unsafe { ffi::magic_file(self.cookie, cf) };
        if s.is_null() {
            Err(self.magic_failure())
        } else {
            Ok(from_c_str_unsafe!(s))
        }
    }
/// Returns a textual description of the contents of the `filename`
Returns a textual description of the contents of the `filename`
Returns a textual description of the contents of the ` filename `
pub fn file(&self, filename: &str) -> Result<String, MagicError> {
        let f = CString::new(filename).map_err(|e| MagicError {
            desc: format!("{:?}", e),
        })?;
        let cf = f.as_ptr();
        let s = unsafe { ffi::magic_file(self.cookie, cf) };
        if s.is_null() {
            Err(self.magic_failure())
        } else {
            Ok(from_c_str_unsafe!(s))
        }
    }
pub fn file ( & self , filename : & str ) -> Result < String , MagicError > { let f = CString :: new ( filename ) . map_err ( | e | MagicError { desc : format ! ( " " e ) , } ) ? ; let cf = f . as_ptr ( ) ; let s = unsafe { ffi :: magic_file ( self . cookie , cf ) } ; if s . is_null ( ) { Err ( self . magic_failure ( ) ) } else { Ok ( from_c_str_unsafe ! ( s ) ) } }
Returns a textual description of the contents of the `filename`
Returns a textual description of the contents of the ` filename `
&self
filename
&str