Skip to main content

Mountain/Binary/Register/
WindSyncRegister.rs

1//! # Wind Sync Register Module
2//!
3//! Initializes the Wind advanced sync functionality.
4
5use std::sync::Arc;
6
7use crate::{
8	IPC::WindAdvancedSync::initialize_wind_advanced_sync,
9	RunTime::ApplicationRunTime::ApplicationRunTime,
10	dev_log,
11};
12
13/// Initializes the Wind advanced sync with the ApplicationRunTime.
14///
15/// # Arguments
16///
17/// * `ApplicationHandle` - The Tauri application handle
18/// * `RunTime` - The ApplicationRunTime instance
19///
20/// # Returns
21///
22/// A `Result` indicating success or failure.
23///
24/// # Wind Advanced Sync Functionality
25///
26/// The Wind advanced sync module provides:
27/// - Document synchronization across instances
28/// - Sync status tracking and reporting
29/// - Update subscription management
30/// - Real-time document change propagation
31///
32/// # Errors
33///
34/// Returns an error if Wind advanced sync initialization fails.
35pub fn WindSyncRegister(ApplicationHandle:&tauri::AppHandle, RunTime:Arc<ApplicationRunTime>) -> Result<(), String> {
36	match initialize_wind_advanced_sync(ApplicationHandle, RunTime) {
37		Ok(()) => {
38			dev_log!("lifecycle", "[IPC] [WindSync] Wind advanced sync initialized successfully.");
39			Ok(())
40		},
41		Err(e) => {
42			dev_log!("lifecycle", "error: [IPC] [WindSync] Failed to initialize: {}", e);
43			Err(format!("Failed to initialize Wind advanced sync: {}", e))
44		},
45	}
46}