liboxen 0.53.0

Oxen is a fast data version control system, built with machine learning training data in mind. Designed to handle terabytes of data with ease, using a workflow similar to git. Version both structured and unstructured data of any modality: text, images, video, audio, CSV, Parquet, JSONL, model checkpoints, and more. liboxen is the embeddable core library behind the oxen CLI and server, which power fine tuning and inference pipelines for multimodal LLMs, image models, and video models on Oxen.ai.
use crate::core::progress::sync_progress::{SyncProgress, SyncType};
use std::borrow::Cow;

pub struct PullProgress {
    sync_progress: SyncProgress,
}

impl Default for PullProgress {
    fn default() -> Self {
        Self::new()
    }
}

impl PullProgress {
    pub fn new() -> Self {
        PullProgress {
            sync_progress: SyncProgress::new(SyncType::Pull),
        }
    }

    pub fn new_with_totals(total_files: u64, total_bytes: u64) -> Self {
        PullProgress {
            sync_progress: SyncProgress::new_with_totals(SyncType::Pull, total_files, total_bytes),
        }
    }

    pub fn set_message(&self, message: impl Into<Cow<'static, str>>) {
        self.sync_progress.set_message(message);
    }

    pub fn update_message(&self) {
        self.sync_progress.update_message();
    }

    pub fn add_files(&self, files: u64) {
        self.sync_progress.add_files(files);
    }

    pub fn add_bytes(&self, bytes: u64) {
        self.sync_progress.add_bytes(bytes);
    }

    pub fn get_num_files(&self) -> u64 {
        self.sync_progress.get_num_files()
    }

    pub fn get_num_bytes(&self) -> u64 {
        self.sync_progress.get_num_bytes()
    }

    pub fn finish(&self) {
        self.sync_progress.finish();
    }
}