add support for yaml and json manifests

This commit is contained in:
Aiden McClelland
2021-07-19 13:50:21 -06:00
parent d9fa354e85
commit c4f38a979e
5 changed files with 38 additions and 17 deletions

View File

@@ -21,8 +21,8 @@ pub struct InstallProgress {
pub download_complete: AtomicBool,
pub validated: AtomicU64,
pub validation_complete: AtomicBool,
pub read: AtomicU64,
pub read_complete: AtomicBool,
pub unpacked: AtomicU64,
pub unpack_complete: AtomicBool,
}
impl InstallProgress {
pub fn new(size: Option<u64>) -> Arc<Self> {
@@ -32,8 +32,8 @@ impl InstallProgress {
download_complete: AtomicBool::new(false),
validated: AtomicU64::new(0),
validation_complete: AtomicBool::new(false),
read: AtomicU64::new(0),
read_complete: AtomicBool::new(false),
unpacked: AtomicU64::new(0),
unpack_complete: AtomicBool::new(false),
})
}
pub fn download_complete(&self) {
@@ -182,7 +182,7 @@ impl<R: AsyncRead> AsyncRead for InstallProgressTracker<R> {
if *this.validating {
&this.progress.validated
} else {
&this.progress.read
&this.progress.unpacked
}
.fetch_add(buf.filled().len() as u64 - prev, Ordering::SeqCst);
@@ -204,7 +204,7 @@ impl<R: AsyncSeek> AsyncSeek for InstallProgressTracker<R> {
if *this.validating {
&this.progress.validated
} else {
&this.progress.read
&this.progress.unpacked
}
.store(n, Ordering::SeqCst);
Poll::Ready(Ok(n))