Struct idx::util::FileProvider [−][src]
pub struct FileProvider { /* fields omitted */ }
Expand description
The FileProvider is the primary method of retrieving raw data from the cache.
In order to function correctly, an index, archive and file ID must be supplied.
The index is type usize
, and the archive and file ID can either be a u32 reference (&u32
) or a String reference (&String
).
use idx::util::FileProvider;
use idx::util::CacheBuilder;
let cache = CacheBuilder::new()
.with_path("test_cache")
.build();
let mut data_provider = FileProvider::from(&cache);
data_provider.index(19).archive(&6);
let data = data_provider.request(&17); //Returns the raw data for file 17 in archive 6 of index 19.
assert_ne!(0, data.len());