bsp_types/
bt_capabilities.rs

1use serde::{Deserialize, Serialize};
2
3/// BuildTarget Capabilities
4#[derive(Debug, Default, Serialize, Deserialize)]
5#[serde(rename_all = "camelCase")]
6pub struct BuildTargetCapabilities {
7    /// This target can be compiled by the BSP server.
8    can_compile: bool,
9
10    /// This target can be tested by the BSP server.
11    can_test: bool,
12
13    /// This target can be run by the BSP server.
14    can_run: bool,
15
16    // This target can be debugged by the BSP server.
17    can_debug: bool,
18}
19
20impl BuildTargetCapabilities {
21    pub fn new(can_compile: bool, can_test: bool, can_run: bool, can_debug: bool) -> Self {
22        Self {
23            can_compile,
24            can_test,
25            can_run,
26            can_debug,
27        }
28    }
29
30    /// Set the bsp build target capabilities's can compile.
31    pub fn set_can_compile(&mut self, can_compile: bool) {
32        self.can_compile = can_compile;
33    }
34
35    /// Get the bsp build target capabilities's can compile.
36    pub fn can_compile(&self) -> bool {
37        self.can_compile
38    }
39
40    /// Set the bsp build target capabilities's can test.
41    pub fn set_can_test(&mut self, can_test: bool) {
42        self.can_test = can_test;
43    }
44
45    /// Get the bsp build target capabilities's can test.
46    pub fn can_test(&self) -> bool {
47        self.can_test
48    }
49
50    /// Set the bsp build target capabilities's can run.
51    pub fn set_can_run(&mut self, can_run: bool) {
52        self.can_run = can_run;
53    }
54
55    /// Get the bsp build target capabilities's can run.
56    pub fn can_run(&self) -> bool {
57        self.can_run
58    }
59
60    /// Set the bsp build target capabilities's can debug.
61    pub fn set_can_debug(&mut self, can_debug: bool) {
62        self.can_debug = can_debug;
63    }
64
65    /// Get the bsp build target capabilities's can debug.
66    pub fn can_debug(&self) -> bool {
67        self.can_debug
68    }
69}