1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
use serde::{Deserialize, Serialize};

/// BuildTarget Capabilities
#[derive(Debug, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BuildTargetCapabilities {
    /// This target can be compiled by the BSP server.
    can_compile: bool,

    /// This target can be tested by the BSP server.
    can_test: bool,

    /// This target can be run by the BSP server.
    can_run: bool,

    // This target can be debugged by the BSP server.
    can_debug: bool,
}

impl BuildTargetCapabilities {
    pub fn new(can_compile: bool, can_test: bool, can_run: bool, can_debug: bool) -> Self {
        Self {
            can_compile,
            can_test,
            can_run,
            can_debug,
        }
    }

    /// Set the bsp build target capabilities's can compile.
    pub fn set_can_compile(&mut self, can_compile: bool) {
        self.can_compile = can_compile;
    }

    /// Get the bsp build target capabilities's can compile.
    pub fn can_compile(&self) -> bool {
        self.can_compile
    }

    /// Set the bsp build target capabilities's can test.
    pub fn set_can_test(&mut self, can_test: bool) {
        self.can_test = can_test;
    }

    /// Get the bsp build target capabilities's can test.
    pub fn can_test(&self) -> bool {
        self.can_test
    }

    /// Set the bsp build target capabilities's can run.
    pub fn set_can_run(&mut self, can_run: bool) {
        self.can_run = can_run;
    }

    /// Get the bsp build target capabilities's can run.
    pub fn can_run(&self) -> bool {
        self.can_run
    }

    /// Set the bsp build target capabilities's can debug.
    pub fn set_can_debug(&mut self, can_debug: bool) {
        self.can_debug = can_debug;
    }

    /// Get the bsp build target capabilities's can debug.
    pub fn can_debug(&self) -> bool {
        self.can_debug
    }
}