pub fn check(&self, filenames: &[&str]) -> Result<(), MagicError> {
        let cstring;
        let dbs = if filenames.len() == 0 {
            ptr::null()
        } else {
            cstring = CString::new(filenames.join(":")).map_err(|e| MagicError {
                desc: format!("{:?}", e),
            })?;
            cstring.as_ptr()
        };

        let rv;
        unsafe {
            rv = ffi::magic_check(self.cookie, dbs);
        }
        if rv == 0 {
            Ok(())
        } else {
            Err(self.magic_failure())
        }
    }
/// Check the validity of entries in the database `filenames`
Check the validity of entries in the database `filenames`
Check the validity of entries in the database ` filenames `
pub fn check(&self, filenames: &[&str]) -> Result<(), MagicError> {
        let cstring;
        let dbs = if filenames.len() == 0 {
            ptr::null()
        } else {
            cstring = CString::new(filenames.join(":")).map_err(|e| MagicError {
                desc: format!("{:?}", e),
            })?;
            cstring.as_ptr()
        };
        let rv;
        unsafe {
            rv = ffi::magic_check(self.cookie, dbs);
        }
        if rv == 0 {
            Ok(())
        } else {
            Err(self.magic_failure())
        }
    }
pub fn check ( & self , filenames : & [ & str ] ) -> Result < ( ) , MagicError > { let cstring ; let dbs = if filenames . len ( ) == 0 { ptr :: null ( ) } else { cstring = CString :: new ( filenames . join ( " " ) ) . map_err ( | e | MagicError { desc : format ! ( " " e ) , } ) ? ; cstring . as_ptr ( ) } ; let rv ; unsafe { rv = ffi :: magic_check ( self . cookie , dbs ) ; } if rv == 0 { Ok ( ( ) ) } else { Err ( self . magic_failure ( ) ) } }
Check the validity of entries in the database `filenames`
Check the validity of entries in the database ` filenames `
&self
filenames
&[&str]