systemprompt_cli/runner/args/impact.rs
1//! Top-level [`DataImpact`] classification of the command tree.
2//!
3//! Each group that can open the profile's database classifies its own
4//! variants exhaustively next to its definition. The groups classified whole
5//! here never open that database: `cloud` targets tenants through the cloud
6//! API, `analytics` is read-only, and `web`/`build` edit files on disk.
7//!
8//! Copyright (c) systemprompt.io — Business Source License 1.1.
9//! See <https://systemprompt.io> for licensing details.
10
11use super::Commands;
12use crate::descriptor::DataImpact;
13
14impl Commands {
15 pub const fn data_impact(&self) -> DataImpact {
16 match self {
17 Self::Core(cmd) => cmd.data_impact(),
18 Self::Infra(cmd) => cmd.data_impact(),
19 Self::Admin(cmd) => cmd.data_impact(),
20 Self::Plugins(cmd) => cmd.data_impact(),
21 Self::Cloud(_) | Self::Analytics(_) | Self::Web(_) | Self::Build(_) => {
22 DataImpact::Preserving
23 },
24 }
25 }
26}