pub fn contents(self, store: Store) -> BoxFuture<Vec<FileContent>, String> {
    let contents = Arc::new(Mutex::new(HashMap::new()));
    let path_stats = self.path_stats;
    Snapshot::contents_for_directory_helper(self.digest, store, PathBuf::from(""), contents.clone())
      .map(move |_| {
        let mut contents = contents.lock().unwrap();
        let mut vec = Vec::new();
        for path in path_stats.iter().filter_map(|path_stat| match path_stat {
          &PathStat::File { ref path, .. } => Some(path.to_path_buf()),
          &PathStat::Dir { .. } => None,
        }) {
          match contents.remove(&path) {
            Some(content) => vec.push(FileContent { path, content }),
            None => {
              panic!(format!(
                "PathStat for {:?} was present in path_stats but missing from Snapshot contents",
                path
              ));
            }
          }
        }
        vec
      })
      .to_boxed()
  }
// Preserves the order of Snapshot's path_stats in its returned Vec.
Preserves the order of Snapshot's path_stats in its returned Vec.
Preserves the order of Snapshot ' s path_stats in its returned Vec .
pub fn contents(self, store: Store) -> BoxFuture<Vec<FileContent>, String> {
    let contents = Arc::new(Mutex::new(HashMap::new()));
    let path_stats = self.path_stats;
    Snapshot::contents_for_directory_helper(self.digest, store, PathBuf::from(""), contents.clone())
      .map(move |_| {
        let mut contents = contents.lock().unwrap();
        let mut vec = Vec::new();
        for path in path_stats.iter().filter_map(|path_stat| match path_stat {
          &PathStat::File { ref path, .. } => Some(path.to_path_buf()),
          &PathStat::Dir { .. } => None,
        }) {
          match contents.remove(&path) {
            Some(content) => vec.push(FileContent { path, content }),
            None => {
              panic!(format!(
                "PathStat for {:?} was present in path_stats but missing from Snapshot contents",
                path
              ));
            }
          }
        }
        vec
      })
      .to_boxed()
  }
pub fn contents ( self , store : Store ) -> BoxFuture < Vec < FileContent > , String > { let contents = Arc :: new ( Mutex :: new ( HashMap :: new ( ) ) ) ; let path_stats = self . path_stats ; Snapshot :: contents_for_directory_helper ( self . digest , store , PathBuf :: from ( " " ) , contents . clone ( ) ) . map ( move | _ | { let mut contents = contents . lock ( ) . unwrap ( ) ; let mut vec = Vec :: new ( ) ; for path in path_stats . iter ( ) . filter_map ( | path_stat | match path_stat { & PathStat :: File { ref path , .. } => Some ( path . to_path_buf ( ) ) , & PathStat :: Dir { .. } => None , } ) { match contents . remove ( & path ) { Some ( content ) => vec . push ( FileContent { path , content } ) , None => { panic ! ( format ( " " path ) ) ; } } } vec } ) . to_boxed ( ) }
Preserves the order of Snapshot's path_stats in its returned Vec.
Preserves the order of Snapshot ' s path_stats in its returned Vec .
self
store
Store
self
store
Store