link_assistant_router/cli/
targets.rs1use super::{AccountOp, AuthTarget, LogsOp, ProviderOp, TokenOp};
9
10impl TokenOp {
11 #[must_use]
13 pub const fn target(&self) -> &AuthTarget {
14 match self {
15 Self::Issue { target, .. }
16 | Self::Rotate { target, .. }
17 | Self::List { target, .. }
18 | Self::Revoke { target, .. }
19 | Self::Expire { target, .. }
20 | Self::Show { target, .. }
21 | Self::RecoverAdmin { target, .. } => target,
22 }
23 }
24}
25
26impl AccountOp {
27 #[must_use]
29 pub const fn target(&self) -> &AuthTarget {
30 match self {
31 Self::List { target, .. } => target,
32 }
33 }
34}
35
36impl ProviderOp {
37 #[must_use]
39 pub const fn target(&self) -> &AuthTarget {
40 match self {
41 Self::List { target, .. }
42 | Self::Add { target, .. }
43 | Self::Show { target, .. }
44 | Self::Remove { target, .. }
45 | Self::Import { target, .. } => target,
46 }
47 }
48}
49
50impl LogsOp {
51 #[must_use]
53 pub const fn target(&self) -> &AuthTarget {
54 match self {
55 Self::Summary { target, .. }
56 | Self::Anomalies { target, .. }
57 | Self::Show { target, .. } => target,
58 }
59 }
60}