zerolaunch_plugin_api/config/
component_core.rs1use crate::config::component_type::ComponentType;
2
3pub struct ComponentCore {
14 pub(crate) component_id: String,
15 pub(crate) component_name: String,
16 pub(crate) component_description: String,
17 pub(crate) component_type: ComponentType,
18 pub(crate) priority: u32,
19}
20
21impl ComponentCore {
22 pub fn new(
23 component_id: String,
24 component_name: String,
25 component_description: String,
26 component_type: ComponentType,
27 priority: u32,
28 ) -> Self {
29 Self {
30 component_id,
31 component_name,
32 component_description,
33 component_type,
34 priority,
35 }
36 }
37
38 pub fn component_id(&self) -> &str {
39 &self.component_id
40 }
41
42 pub fn component_name(&self) -> &str {
43 &self.component_name
44 }
45
46 pub fn component_description(&self) -> &str {
47 &self.component_description
48 }
49
50 pub fn component_type(&self) -> ComponentType {
51 self.component_type
52 }
53
54 pub fn priority(&self) -> u32 {
55 self.priority
56 }
57}
58
59impl std::fmt::Debug for ComponentCore {
60 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
61 f.debug_struct("ComponentCore")
62 .field("component_id", &self.component_id)
63 .field("component_name", &self.component_name)
64 .field("component_description", &self.component_description)
65 .field("component_type", &self.component_type)
66 .field("priority", &self.priority)
67 .finish()
68 }
69}