#![forbid(unsafe_code)]
#![warn(missing_docs)]

//! Service management backends for provctl.
//!
//! This crate provides abstraction over different service management systems:
//! - **systemd** (Linux) - Production-grade service manager
//! - **launchd** (macOS) - Apple's service management
//! - **pidfile** (Universal) - Fallback using simple PID files
//!
//! The `Backend` trait allows testing with mock implementations.
//!
//! # Examples
//!
//! ```ignore
//! use provctl_backend::{Backend, PidfileBackend};
//! use provctl_core::{ServiceName, ServiceDefinition};
//! use std::path::PathBuf;
//!
//! let backend = PidfileBackend::new("/tmp");
//! let service = ServiceDefinition::new(
//!     ServiceName::new("api")?,
//!     PathBuf::from("/usr/bin/api"),
//! );
//!
//! let pid = backend.start(&service).await?;
//! println!("Started with PID: {}", pid);
//! ```

/// Service management backend trait and implementations.
pub mod backend;

/// PID-file based service backend (universal, works on any Unix).
pub mod pidfile;

pub use backend::Backend;
pub use pidfile::PidfileBackend;
