use std::sync::Arc;
use turbovault_batch::{BatchExecutor, BatchOperation, BatchResult};
use turbovault_core::prelude::*;
use turbovault_vault::VaultManager;
pub struct BatchTools {
pub manager: Arc<VaultManager>,
}
impl BatchTools {
pub fn new(manager: Arc<VaultManager>) -> Self {
Self { manager }
}
pub async fn batch_execute(&self, operations: Vec<BatchOperation>) -> Result<BatchResult> {
let temp_dir_handle = tempfile::tempdir().map_err(|e| {
Error::config_error(format!("Failed to create temp directory for batch: {}", e))
})?;
let temp_dir = temp_dir_handle.path().to_path_buf();
let _temp_dir_persistent = temp_dir_handle.keep();
let executor = BatchExecutor::new(self.manager.clone(), temp_dir);
executor.execute(operations).await
}
}
#[cfg(test)]
mod tests {
#[test]
fn test_batch_tools_creation() {
}
}