Files
kk0t9 bfe490e899 refactor(review): shell current-thread runtime + единый дефолт; PowerClient parse_enum; тесты на ipc::names
- shell: new_current_thread рантайм (без пула на холодном старте, #11); единый Initial::default().
- PowerClient: generic parse_enum (убрал 3 копии map_err).
- ipc::names::power::MOCK_IFACE; интеграционные тесты — через ipc::names (не хардкод).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 14:36:50 +03:00

30 lines
1.2 KiB
Rust

//! Well-known имена / пути объектов / имена интерфейсов (ipc §2).
//! `ru.shturman.<Service>` · `/ru/shturman/<Service>` · `ru.shturman.<Service>N` (N = мажор).
pub mod power {
pub const NAME: &str = "ru.shturman.Power";
pub const PATH: &str = "/ru/shturman/Power";
pub const IFACE: &str = "ru.shturman.Power1";
/// dev-mock «fake-ACC» (интерфейс на том же объекте; только dev-сборка).
pub const MOCK_IFACE: &str = "ru.shturman.dev.PowerMock1";
}
pub mod settings {
pub const NAME: &str = "ru.shturman.Settings";
pub const PATH: &str = "/ru/shturman/Settings";
pub const IFACE: &str = "ru.shturman.Settings1";
}
#[cfg(test)]
mod tests {
#[test]
fn names_follow_convention() {
assert_eq!(super::power::NAME, "ru.shturman.Power");
assert_eq!(super::power::PATH, "/ru/shturman/Power");
assert_eq!(super::power::IFACE, "ru.shturman.Power1");
assert_eq!(super::settings::NAME, "ru.shturman.Settings");
assert_eq!(super::settings::PATH, "/ru/shturman/Settings");
assert_eq!(super::settings::IFACE, "ru.shturman.Settings1");
}
}