fn new_log_file(
    path: &Path,
    gen: u64,
    readers: &mut HashMap<u64, BufReaderWithPos<File>>,
) -> Result<BufWriterWithPos<File>> {
    let path = log_path(&path, gen);
    let writer = BufWriterWithPos::new(
        OpenOptions::new().create(true).write(true).append(true).open(&path)?,
    )?;
    readers.insert(gen, BufReaderWithPos::new(File::open(&path)?)?);
    Ok(writer)
}
/// Create a new log file with given generation number and add the reader to the readers map.
///
/// Returns the writer to the log.
Create a new log file with given generation number and add the reader to the readers map.
Returns the writer to the log.
Create a new log file with given generation number and add the reader to the readers map . Returns the writer to the log .
fn new_log_file(
    path: &Path,
    gen: u64,
    readers: &mut HashMap<u64, BufReaderWithPos<File>>,
) -> Result<BufWriterWithPos<File>> {
    let path = log_path(&path, gen);
    let writer = BufWriterWithPos::new(
        OpenOptions::new().create(true).write(true).append(true).open(&path)?,
    )?;
    readers.insert(gen, BufReaderWithPos::new(File::open(&path)?)?);
    Ok(writer)
}
fn new_log_file ( path : & Path , gen : u64 , readers : & mut HashMap < u64 , BufReaderWithPos < File > > , ) -> Result < BufWriterWithPos < File > > { let path = log_path ( & path , gen ) ; let writer = BufWriterWithPos :: new ( OpenOptions :: new ( ) . create ( true ) . write ( true ) . append ( true ) . open ( & path ) ? , ) ? ; readers . insert ( gen , BufReaderWithPos :: new ( File :: open ( & path ) ? ) ? ) ; Ok ( writer ) }
Create a new log file with given generation number and add the reader to the readers map.
Create a new log file with given generation number and add the reader to the readers map .
path
&Path
gen
u64
readers
&mut HashMap<u64, BufReaderWithPos<File>>
path
&Path
gen
u64
readers
&mut HashMap<u64, BufReaderWithPos<File>>