weave-agentfs-mirror · sync
Source declarations, signatures and documentation for sync.
Reviewed implementation boundary: The mirror plan executor contains NotImplemented paths. A generated plan is not a successfully synchronized remote filesystem. See /libraries/agentfs-mirror/overview.
Source: sigil/weave/local/agentfs-mirror/src/sync.rs. SHA-256: 2c49fc5077f9e73c10120a2abe7b79aced98131d79a77738f5c7fe50f4a648bf.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
sync::SyncState
Sync state tracking
#[derive(Debug, Clone)]
pub struct SyncState {
/// Current stats
pub stats: SyncStats,
/// Sparse sync engine
pub sparse: Option<SparseSync>,
/// Conflict resolver
pub resolver: ConflictResolver,
/// Progress sender
pub progress_tx: Option<tokio::sync::mpsc::UnboundedSender<ProgressEvent>>
}Source line: 21.
sync::PlanOp
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct PlanOp {
pub id: String,
pub kind: String,
pub src: Option<String>,
pub dst: Option<String>,
pub size: Option<u64>,
pub mtime: Option<i64>
}Source line: 36.
sync::Plan
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Plan {
pub plan_id: String,
pub ops: Vec<PlanOp>
}Source line: 46.
sync::Checkpoint
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Default)]
pub struct Checkpoint {
pub plan_id: String,
pub last_applied_index: i64,
pub applied: Vec<String>
}Source line: 52.
sync::SyncEngine
Sync engine
pub struct SyncEngine {
}Source line: 59.
sync::SyncEngine::new
Create new sync engine
pub fn new(
source: Arc<dyn agentfs_diff::FileSystem>,
target: Arc<dyn agentfs_diff::FileSystem>,
options: MirrorOptions,
) -> Self;Source line: 78.
sync::SyncEngine::sync
Perform synchronization
pub async fn sync(&self, state: &mut SyncState) -> Result<()>;Source line: 93.
sync::SyncEngine::plan_from_diffs
Create a deterministic plan from diffs
pub async fn plan_from_diffs(&self, diffs: Vec<Diff>) -> Result<Plan>;Source line: 278.
sync::SyncEngine::execute_plan
Execute a plan with checkpointing (skeleton)
pub async fn execute_plan(&self, _plan: &Plan, _checkpoint: &mut Checkpoint) -> Result<()>;Source line: 332.