1use std::collections::HashMap;
4
5use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
9#[non_exhaustive]
10pub struct DapAdapterConfig {
11 pub command: String,
13 pub args: Vec<String>,
15 pub env: HashMap<String, String>,
17}
18
19impl DapAdapterConfig {
20 #[must_use]
22 pub fn new(command: impl Into<String>) -> Self {
23 Self {
24 command: command.into(),
25 args: Vec::new(),
26 env: HashMap::new(),
27 }
28 }
29
30 #[must_use]
32 pub fn with_args(mut self, args: Vec<String>) -> Self {
33 self.args = args;
34 self
35 }
36
37 #[must_use]
39 pub fn with_env(mut self, env: HashMap<String, String>) -> Self {
40 self.env = env;
41 self
42 }
43}
44
45#[derive(Debug, Clone, Serialize, Deserialize)]
47#[non_exhaustive]
48pub struct DapPluginConfig {
49 pub auto_shutdown: bool,
51}
52
53impl Default for DapPluginConfig {
54 fn default() -> Self {
55 Self {
56 auto_shutdown: true,
57 }
58 }
59}