/// Opens a library file for reading.
/// The file must be dropped before the library database is dropped.
Opens a library file for reading.
The file must be dropped before the library database is dropped.
Opens a library file for reading . The file must be dropped before the library database is dropped .
pub fn open_file(&self, path: &str) -> io::Result<LibraryFile> {
        let path = Nfc::caseless_path(&path);
        for arc_library in &self.arc_libraries {
            let library = arc_library.read().unwrap();
            if let Some(index) = library.find(&path) {
                return Ok(LibraryFile {
                    index,
                    arc_library: arc_library.to_owned(),
                    position: library.entries[index].data_start,
                });
            }
        }
        Err(io::ErrorKind::NotFound.into())
    }
pub fn open_file ( & self , path : & str ) -> io :: Result < LibraryFile > { let path = Nfc :: caseless_path ( & path ) ; for arc_library in & self . arc_libraries { let library = arc_library . read ( ) . unwrap ( ) ; if let Some ( index ) = library . find ( & path ) { return Ok ( LibraryFile { index , arc_library : arc_library . to_owned ( ) , position : library . entries [ index ] . data_start , } ) ; } } Err ( io :: ErrorKind :: NotFound . into ( ) ) }
Opens a library file for reading.
Opens a library file for reading .
&self
path
&str