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