pub fn new_directory_reader(system: Arc<F>, dir: &Path) -> Result<Self> {
            if !dir.is_dir() {
                return Err(Error::InvalidArgument(format!(
                    "Not a directory: {}",
                    dir.display()
                )));
            }
            let mut files: Vec<_> = std::fs::read_dir(dir)?
                .filter_map(|e| {
                    if let Ok(e) = e {
                        let p = e.path();
                        if p.is_file() {
                            if let Some(file_id) =
                                FileId::parse_file_name(p.file_name().unwrap().to_str().unwrap())
                            {
                                return Some((file_id, p));
                            }
                        }
                    }
                    None
                })
                .collect();
            files.sort_by_key(|pair| pair.0);
            Ok(Self {
                system,
                files: files.into(),
                batch_reader: LogItemBatchFileReader::new(0),
                items: VecDeque::new(),
            })
        }
/// Creates a new log item reader over all log files under the
/// specified directory.
Creates a new log item reader over all log files under the
specified directory.
Creates a new log item reader over all log files under the specified directory .
pub fn new_directory_reader(system: Arc<F>, dir: &Path) -> Result<Self> {
            if !dir.is_dir() {
                return Err(Error::InvalidArgument(format!(
                    "Not a directory: {}",
                    dir.display()
                )));
            }
            let mut files: Vec<_> = std::fs::read_dir(dir)?
                .filter_map(|e| {
                    if let Ok(e) = e {
                        let p = e.path();
                        if p.is_file() {
                            if let Some(file_id) =
                                FileId::parse_file_name(p.file_name().unwrap().to_str().unwrap())
                            {
                                return Some((file_id, p));
                            }
                        }
                    }
                    None
                })
                .collect();
            files.sort_by_key(|pair| pair.0);
            Ok(Self {
                system,
                files: files.into(),
                batch_reader: LogItemBatchFileReader::new(0),
                items: VecDeque::new(),
            })
        }
pub fn new_directory_reader ( system : Arc < F > , dir : & Path ) -> Result < Self > { if ! dir . is_dir ( ) { return Err ( Error :: InvalidArgument ( format ! ( " " dir display ( ) ) ) ) ; } let mut files : Vec < _ > = std :: fs :: read_dir ( dir ) ? . filter_map ( | e | { if let Ok ( e ) = e { let p = e . path ( ) ; if p . is_file ( ) { if let Some ( file_id ) = FileId :: parse_file_name ( p . file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ) { return Some ( ( file_id , p ) ) ; } } } None } ) . collect ( ) ; files . sort_by_key ( | pair | pair . 0 ) ; Ok ( Self { system , files : files . into ( ) , batch_reader : LogItemBatchFileReader :: new ( 0 ) , items : VecDeque :: new ( ) , } ) }
Creates a new log item reader over all log files under the
specified directory.
Creates a new log item reader over all log files under the specified directory .
system
Arc<F>
dir
&Path