pub fn contents_for_directory(&self, digest: Digest) -> BoxFuture<Vec<FileContent>, String> {
    self
      .walk(digest, |store, path_so_far, _, directory| {
        future::join_all(
          directory
            .get_files()
            .iter()
            .map(move |file_node| {
              let path = path_so_far.join(file_node.get_name());
              store
                .load_file_bytes_with(try_future!(file_node.get_digest().into()), |b| b)
                .and_then(move |maybe_bytes| {
                  maybe_bytes
                    .ok_or_else(|| format!("Couldn't find file contents for {:?}", path))
                    .map(|content| FileContent { path, content })
                })
                .to_boxed()
            })
            .collect::<Vec<_>>(),
        )
        .to_boxed()
      })
      .map(|file_contents_per_directory| {
        let mut vec =
          Iterator::flatten(file_contents_per_directory.into_iter().map(Vec::into_iter))
            .collect::<Vec<_>>();
        vec.sort_by(|l, r| l.path.cmp(&r.path));
        vec
      })
      .to_boxed()
  }
// Returns files sorted by their path.
Returns files sorted by their path.
Returns files sorted by their path .
pub fn contents_for_directory(&self, digest: Digest) -> BoxFuture<Vec<FileContent>, String> {
    self
      .walk(digest, |store, path_so_far, _, directory| {
        future::join_all(
          directory
            .get_files()
            .iter()
            .map(move |file_node| {
              let path = path_so_far.join(file_node.get_name());
              store
                .load_file_bytes_with(try_future!(file_node.get_digest().into()), |b| b)
                .and_then(move |maybe_bytes| {
                  maybe_bytes
                    .ok_or_else(|| format!("Couldn't find file contents for {:?}", path))
                    .map(|content| FileContent { path, content })
                })
                .to_boxed()
            })
            .collect::<Vec<_>>(),
        )
        .to_boxed()
      })
      .map(|file_contents_per_directory| {
        let mut vec =
          Iterator::flatten(file_contents_per_directory.into_iter().map(Vec::into_iter))
            .collect::<Vec<_>>();
        vec.sort_by(|l, r| l.path.cmp(&r.path));
        vec
      })
      .to_boxed()
  }
pub fn contents_for_directory ( & self , digest : Digest ) -> BoxFuture < Vec < FileContent > , String > { self . walk ( digest , | store , path_so_far , _ , directory | { future :: join_all ( directory . get_files ( ) . iter ( ) . map ( move | file_node | { let path = path_so_far . join ( file_node . get_name ( ) ) ; store . load_file_bytes_with ( try_future ! ( file_node get_digest ( ) into ( ) ) , | b | b ) . and_then ( move | maybe_bytes | { maybe_bytes . ok_or_else ( | | format ! ( " " path ) ) . map ( | content | FileContent { path , content } ) } ) . to_boxed ( ) } ) . collect :: < Vec < _ > > ( ) , ) . to_boxed ( ) } ) . map ( | file_contents_per_directory | { let mut vec = Iterator :: flatten ( file_contents_per_directory . into_iter ( ) . map ( Vec :: into_iter ) ) . collect :: < Vec < _ > > ( ) ; vec . sort_by ( | l , r | l . path . cmp ( & r . path ) ) ; vec } ) . to_boxed ( ) }
Returns files sorted by their path.
Returns files sorted by their path .
&self
digest
Digest
&self
digest
Digest