/// Get all metadata stored in the index.
/// The index is stored by identifier and current date to make it easier to
/// sync over git and compact old entries in the future.
Get all metadata stored in the index.
The index is stored by identifier and current date to make it easier to
sync over git and compact old entries in the future.
Get all metadata stored in the index . The index is stored by identifier and current date to make it easier to sync over git and compact old entries in the future .
fn metadata(&self) -> Result<BTreeSet<Metadata>, Error> {
        let glob_string = self
            .folder_path
            .join(IDENTIFIER_FOLDER_NAME)
            .join("*")
            .join(format!("*.{}", IDENTIFIER_FILE_EXTENTION));
        let glob = glob::glob(&glob_string.to_string_lossy()).map_err(Error::InvalidGlob)?;
        let mut index_paths = glob
            .collect::<Result<Vec<PathBuf>, glob::GlobError>>()
            .map_err(Error::GlobIteration)?;
        let index_file_path = self.folder_path.join(INDEX_FILE_NAME);
        if index_file_path.exists() {
            index_paths.push(index_file_path);
        }
        trace!("index_paths: {:?}", index_paths);
        let metadata = index_paths
            .into_iter()
            .map(Index::read_metadata_file)
            .collect::<Result<Vec<Vec<_>>, Error>>()?
            .into_iter()
            .flatten()
            .collect();
        Ok(metadata)
    }
fn metadata ( & self ) -> Result < BTreeSet < Metadata > , Error > { let glob_string = self . folder_path . join ( IDENTIFIER_FOLDER_NAME ) . join ( " " ) . join ( format ! ( " " IDENTIFIER_FILE_EXTENTION ) ) ; let glob = glob :: glob ( & glob_string . to_string_lossy ( ) ) . map_err ( Error :: InvalidGlob ) ? ; let mut index_paths = glob . collect :: < Result < Vec < PathBuf > , glob :: GlobError > > ( ) . map_err ( Error :: GlobIteration ) ? ; let index_file_path = self . folder_path . join ( INDEX_FILE_NAME ) ; if index_file_path . exists ( ) { index_paths . push ( index_file_path ) ; } trace ! ( " " index_paths ) ; let metadata = index_paths . into_iter ( ) . map ( Index :: read_metadata_file ) . collect :: < Result < Vec < Vec < _ > > , Error > > ( ) ? . into_iter ( ) . flatten ( ) . collect ( ) ; Ok ( metadata ) }
Get all metadata stored in the index.
Get all metadata stored in the index .
&self