sparseio 0.0.1

A library for coordinating sparse, out-of-order byte-range fetching and materialization of large objects.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::path::{Path, PathBuf};

/// Creates a temporary directory helper for file-backed tests and examples.
///
/// The returned directory is removed automatically when dropped.
pub fn temp_dir() -> tempfile::TempDir {
    tempfile::tempdir().expect("tempdir should be created")
}

/// Returns a child path under a temporary directory.
///
/// This keeps file-backed tests concise while still using per-test paths.
pub fn temp_path(dir: &Path, name: &str) -> PathBuf {
    dir.join(name)
}