mirror of https://github.com/zkat/cacache-rs.git
feat(content): add baseline read functionality
This commit is contained in:
parent
0f768fa5c0
commit
e98bfb17da
|
|
@ -1 +1,2 @@
|
|||
pub mod path;
|
||||
pub mod read;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
use crate::content::path::content_path;
|
||||
use ssri::Integrity;
|
||||
use std::path::Path;
|
||||
use std::fs::File;
|
||||
|
||||
pub fn open(cache: &Path, sri: &Integrity) -> std::io::Result<File> {
|
||||
File::open(content_path(&cache, &sri))
|
||||
}
|
||||
|
||||
pub fn copy(cache: &Path, sri: &Integrity, to: &Path) -> std::io::Result<u64> {
|
||||
std::fs::copy(content_path(&cache, &sri), to)
|
||||
}
|
||||
|
|
@ -1,2 +1,3 @@
|
|||
mod content;
|
||||
pub use crate::content::path;
|
||||
pub use crate::content::read;
|
||||
|
|
|
|||
Loading…
Reference in New Issue