pub fn capture_snapshot_from_arbitrary_root<P: AsRef<Path> + Send + 'static>(
    store: Store,
    fs_pool: Arc<ResettablePool>,
    root_path: P,
    path_globs: PathGlobs,
    digest_hint: Option<Digest>,
  ) -> BoxFuture<Snapshot, String> {
    // Attempt to use the digest hint to load a Snapshot without expanding the globs; otherwise,
    // expand the globs to capture a Snapshot.
    let store2 = store.clone();
    future::result(digest_hint.ok_or_else(|| "No digest hint provided.".to_string()))
      .and_then(move |digest| Snapshot::from_digest(store, digest))
      .or_else(|_| {
        let posix_fs = Arc::new(try_future!(PosixFS::new(root_path, fs_pool, &[])));

        posix_fs
          .expand(path_globs)
          .map_err(|err| format!("Error expanding globs: {:?}", err))
          .and_then(|path_stats| {
            Snapshot::from_path_stats(
              store2.clone(),
              &OneOffStoreFileByDigest::new(store2, posix_fs),
              path_stats,
            )
          })
          .to_boxed()
      })
      .to_boxed()
  }
///
/// Capture a Snapshot of a presumed-immutable piece of the filesystem.
///
/// Note that we don't use a Graph here, and don't cache any intermediate steps, we just place
/// the resultant Snapshot into the store and return it. This is important, because we're reading
/// things from arbitrary filepaths which we don't want to cache in the graph, as we don't watch
/// them for changes.
///
/// If the `digest_hint` is given, first attempt to load the Snapshot using that Digest, and only
/// fall back to actually walking the filesystem if we don't have it (either due to garbage
/// collection or Digest-oblivious legacy caching).
///
Capture a Snapshot of a presumed-immutable piece of the filesystem.
Note that we don't use a Graph here, and don't cache any intermediate steps, we just place
the resultant Snapshot into the store and return it. This is important, because we're reading
things from arbitrary filepaths which we don't want to cache in the graph, as we don't watch
them for changes.

If the `digest_hint` is given, first attempt to load the Snapshot using that Digest, and only
fall back to actually walking the filesystem if we don't have it (either due to garbage
collection or Digest-oblivious legacy caching).
Capture a Snapshot of a presumed - immutable piece of the filesystem . Note that we don ' t use a Graph here and don ' t cache any intermediate steps we just place the resultant Snapshot into the store and return it . This is important because we ' re reading things from arbitrary filepaths which we don ' t want to cache in the graph as we don ' t watch them for changes . If the ` digest_hint ` is given first attempt to load the Snapshot using that Digest and only fall back to actually walking the filesystem if we don ' t have it ( either due to garbage collection or Digest - oblivious legacy caching ) .
pub fn capture_snapshot_from_arbitrary_root<P: AsRef<Path> + Send + 'static>(
    store: Store,
    fs_pool: Arc<ResettablePool>,
    root_path: P,
    path_globs: PathGlobs,
    digest_hint: Option<Digest>,
  ) -> BoxFuture<Snapshot, String> {
    // Attempt to use the digest hint to load a Snapshot without expanding the globs; otherwise,
    // expand the globs to capture a Snapshot.
    let store2 = store.clone();
    future::result(digest_hint.ok_or_else(|| "No digest hint provided.".to_string()))
      .and_then(move |digest| Snapshot::from_digest(store, digest))
      .or_else(|_| {
        let posix_fs = Arc::new(try_future!(PosixFS::new(root_path, fs_pool, &[])));
        posix_fs
          .expand(path_globs)
          .map_err(|err| format!("Error expanding globs: {:?}", err))
          .and_then(|path_stats| {
            Snapshot::from_path_stats(
              store2.clone(),
              &OneOffStoreFileByDigest::new(store2, posix_fs),
              path_stats,
            )
          })
          .to_boxed()
      })
      .to_boxed()
  }
pub fn capture_snapshot_from_arbitrary_root < P : AsRef < Path > + Send + ' static > ( store : Store , fs_pool : Arc < ResettablePool > , root_path : P , path_globs : PathGlobs , digest_hint : Option < Digest > , ) -> BoxFuture < Snapshot , String > { // Attempt to use the digest hint to load a Snapshot without expanding the globs; otherwise, // expand the globs to capture a Snapshot. let store2 = store . clone ( ) ; future :: result ( digest_hint . ok_or_else ( | | " " . to_string ( ) ) ) . and_then ( move | digest | Snapshot :: from_digest ( store , digest ) ) . or_else ( | _ | { let posix_fs = Arc :: new ( try_future ! ( PosixFS new ( root_path fs_pool [ ] ) ) ) ; posix_fs . expand ( path_globs ) . map_err ( | err | format ! ( " " err ) ) . and_then ( | path_stats | { Snapshot :: from_path_stats ( store2 . clone ( ) , & OneOffStoreFileByDigest :: new ( store2 , posix_fs ) , path_stats , ) } ) . to_boxed ( ) } ) . to_boxed ( ) }
Capture a Snapshot of a presumed-immutable piece of the filesystem.
Capture a Snapshot of a presumed - immutable piece of the filesystem .
store
Store
fs_pool
Arc<ResettablePool>
root_path
P
path_globs
PathGlobs
digest_hint
Option<Digest>
store
Store
fs_pool
Arc<ResettablePool>
root_path
P
path_globs
PathGlobs
digest_hint
Option<Digest>