Skip to main content

spreadsheet_kit/recalc/
executor.rs

1#[cfg(feature = "recalc-libreoffice")]
2use anyhow::Result;
3#[cfg(feature = "recalc-libreoffice")]
4use async_trait::async_trait;
5#[cfg(feature = "recalc-libreoffice")]
6use std::path::Path;
7
8#[cfg(feature = "recalc-libreoffice")]
9#[async_trait]
10pub trait RecalcExecutor: Send + Sync {
11    async fn recalculate(&self, workbook_path: &Path) -> Result<RecalcResult>;
12    fn is_available(&self) -> bool;
13}
14
15#[derive(Debug, Clone)]
16pub struct RecalcResult {
17    pub duration_ms: u64,
18    pub was_warm: bool,
19    pub backend_name: &'static str,
20    pub cells_evaluated: Option<u64>,
21    pub eval_errors: Option<Vec<String>>,
22}