P0: config, DTOs, source traits, fakes, error, state and module stubs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ariandClaude Sonnet 5.5 committed 2026-10-15 17:23:17 -04:00
1 parent aa9b0da962
commit 1802f97d94
22 files changed
+1736

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
//! systemd source over D-Bus (WS-A owns this file).
//!
//! STUB: signatures are final, bodies are `todo!()`.
//! Notes for WS-A: use `zbus_systemd::systemd1::{ManagerProxy, UnitProxy,
//! ServiceProxy, TimerProxy}`. There is no `ListTimers` method; list `*.timer`
//! units and read `TimerProxy` properties (see plan/review.md R1, R2).
use async_trait::async_trait;
use tokio_util::sync::CancellationToken;
use super::{SystemdSource, TimerInfo, UnitStatus, UnitSummary};
use crate::config::Config;
use crate::error::AppError;
pub struct DbusSystemd {}
impl DbusSystemd {
/// Must not fail or block: connect to the bus lazily on first use and map
/// connection errors to `AppError::Unavailable`.
pub fn new(_config: &Config, _shutdown: CancellationToken) -> Self {
Self {}
}
}
#[async_trait]
impl SystemdSource for DbusSystemd {
async fn list_units(&self, _state: Option<&str>) -> Result<Vec<UnitSummary>, AppError> {
todo!("WS-A A2")
}
async fn list_timers(&self) -> Result<Vec<TimerInfo>, AppError> {
todo!("WS-A A3")
}
async fn unit_status(&self, _name: &str) -> Result<UnitStatus, AppError> {
todo!("WS-A A4")
}
}