Skip to main content

kaizen/sync/
context.rs

1// SPDX-License-Identifier: AGPL-3.0-or-later
2//! Context passed when appending events so the store can enqueue the sync outbox.
3
4use crate::core::config::SyncConfig;
5use std::path::{Path, PathBuf};
6
7/// Everything needed to optionally enqueue a redacted row after a successful insert.
8#[derive(Debug, Clone)]
9pub struct SyncIngestContext {
10    pub sync: SyncConfig,
11    pub workspace_root: PathBuf,
12}
13
14impl SyncIngestContext {
15    pub fn new(sync: SyncConfig, workspace_root: PathBuf) -> Self {
16        Self {
17            sync,
18            workspace_root,
19        }
20    }
21
22    pub fn workspace_root(&self) -> &Path {
23        &self.workspace_root
24    }
25}