pub fn load_file<'a, P>(
    file: P,
    config: RecordIndexerConfig,
) -> Result<impl Iterator<Item = Result<RecordIndex>>>
where
    P: Into<Cow<'a, Path>>,
{
    let file = file.into().into_owned();
    let reader = BufReader::new(File::open(&file)?);
    let file = Arc::new(file);
    let iter = load_reader(reader, config).map(move |pos| {
        let Position { offset, len } = pos?;
        Ok(RecordIndex {
            path: file.clone(),
            offset,
            len,
        })
    });
    Ok(iter)
}
/// Load record indexes from a file.
Load record indexes from a file.
Load record indexes from a file .
pub fn load_file<'a, P>(
    file: P,
    config: RecordIndexerConfig,
) -> Result<impl Iterator<Item = Result<RecordIndex>>>
where
    P: Into<Cow<'a, Path>>,
{
    let file = file.into().into_owned();
    let reader = BufReader::new(File::open(&file)?);
    let file = Arc::new(file);
    let iter = load_reader(reader, config).map(move |pos| {
        let Position { offset, len } = pos?;
        Ok(RecordIndex {
            path: file.clone(),
            offset,
            len,
        })
    });
    Ok(iter)
}
pub fn load_file < ' a , P > ( file : P , config : RecordIndexerConfig , ) -> Result < impl Iterator < Item = Result < RecordIndex > > > where P : Into < Cow < ' a , Path > > , { let file = file . into ( ) . into_owned ( ) ; let reader = BufReader :: new ( File :: open ( & file ) ? ) ; let file = Arc :: new ( file ) ; let iter = load_reader ( reader , config ) . map ( move | pos | { let Position { offset , len } = pos ? ; Ok ( RecordIndex { path : file . clone ( ) , offset , len , } ) } ) ; Ok ( iter ) }
Load record indexes from a file.
Load record indexes from a file .
file
P
config
RecordIndexerConfig
file
P
config
RecordIndexerConfig