#[cfg(feature = "async")]
pub mod r#async;
mod index;
pub mod io;
mod record;
pub use self::{index::Index, record::Record};
#[deprecated(since = "0.44.0", note = "Use `fai::io::Reader` instead.")]
pub use self::io::Reader;
#[deprecated(since = "0.44.0", note = "Use `fai::io::Writer` instead.")]
pub use self::io::Writer;
#[cfg(feature = "async")]
#[deprecated(since = "0.44.0", note = "Use `fai::r#async::io::Reader` instead.")]
pub use self::r#async::io::Reader as AsyncReader;
use std::{fs::File, io::BufReader, path::Path};
pub fn read<P>(src: P) -> std::io::Result<Index>
where
P: AsRef<Path>,
{
let mut reader = File::open(src).map(BufReader::new).map(Reader::new)?;
reader.read_index()
}