pub fn new_file_reader(system: Arc<F>, file: &Path) -> Result<Self> {
            if !file.is_file() {
                return Err(Error::InvalidArgument(format!(
                    "Not a file: {}",
                    file.display()
                )));
            }
            let file_name = file.file_name().unwrap().to_str().unwrap();
            let file_id = FileId::parse_file_name(file_name);
            if file_id.is_none() {
                return Err(Error::InvalidArgument(format!(
                    "Invalid log file name: {}",
                    file_name
                )));
            }
            Ok(Self {
                system,
                files: vec![(file_id.unwrap(), file.into())].into(),
                batch_reader: LogItemBatchFileReader::new(0),
                items: VecDeque::new(),
            })
        }
/// Creates a new log item reader over one specified log file.
Creates a new log item reader over one specified log file.
Creates a new log item reader over one specified log file .
pub fn new_file_reader(system: Arc<F>, file: &Path) -> Result<Self> {
            if !file.is_file() {
                return Err(Error::InvalidArgument(format!(
                    "Not a file: {}",
                    file.display()
                )));
            }
            let file_name = file.file_name().unwrap().to_str().unwrap();
            let file_id = FileId::parse_file_name(file_name);
            if file_id.is_none() {
                return Err(Error::InvalidArgument(format!(
                    "Invalid log file name: {}",
                    file_name
                )));
            }
            Ok(Self {
                system,
                files: vec![(file_id.unwrap(), file.into())].into(),
                batch_reader: LogItemBatchFileReader::new(0),
                items: VecDeque::new(),
            })
        }
pub fn new_file_reader ( system : Arc < F > , file : & Path ) -> Result < Self > { if ! file . is_file ( ) { return Err ( Error :: InvalidArgument ( format ! ( " " file display ( ) ) ) ) ; } let file_name = file . file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ; let file_id = FileId :: parse_file_name ( file_name ) ; if file_id . is_none ( ) { return Err ( Error :: InvalidArgument ( format ! ( " " file_name ) ) ) ; } Ok ( Self { system , files : vec ! [ ( file_id unwrap ( ) file into ( ) ) ] . into ( ) , batch_reader : LogItemBatchFileReader :: new ( 0 ) , items : VecDeque :: new ( ) , } ) }
Creates a new log item reader over one specified log file.
Creates a new log item reader over one specified log file .
system
Arc<F>
file
&Path