scientific_method/
control.rs1#[derive(Debug, Clone, PartialEq, Eq)]
5#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6pub struct Control {
7 pub name: String,
8 pub description: Option<String>,
9}
10
11impl Control {
12 pub fn new(name: impl Into<String>) -> Self {
13 Self {
14 name: name.into(),
15 description: None,
16 }
17 }
18
19 pub fn with_description(mut self, description: impl Into<String>) -> Self {
20 self.description = Some(description.into());
21 self
22 }
23}