framework_startup/lib.rs
1//! 开机自启的注册、注销与启停。
2//!
3//! 对外只暴露统一配置 [`StartupConfig`] 与统一入口 [`Startup`],各操作系统的差异由本 crate 内部承担:
4//!
5//! - Windows:任务计划程序(`schtasks`)
6//! - Linux:systemd(系统级 `/etc/systemd/system`,用户级 `~/.config/systemd/user`)
7//! - macOS:launchd(系统级 `/Library/LaunchDaemons`,用户级 `~/Library/LaunchAgents`)
8//!
9//! 各平台的实现按编译目标门控,非目标平台的代码与依赖不参与编译。
10
11pub mod config;
12pub mod startup;
13
14mod platform;
15mod scope;
16
17#[cfg(any(target_os = "linux", target_os = "macos"))]
18mod directory;
19
20#[cfg(any(target_os = "linux", target_os = "macos"))]
21mod file;
22
23#[cfg(target_os = "linux")]
24mod linux;
25
26#[cfg(target_os = "macos")]
27mod macos;
28
29#[cfg(target_os = "windows")]
30mod windows;
31
32pub use config::StartupConfig;
33pub use startup::Startup;