scientific-method 0.2.0

The parts of the scientific method used to define and evaluate experiments.
Documentation
// Copyright © 2026 James Hunt. All rights reserved.

/// A condition held fixed while an experiment is performed.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Control {
    pub name: String,
    pub description: Option<String>,
}

impl Control {
    pub fn new(name: impl Into<String>) -> Self {
        Self {
            name: name.into(),
            description: None,
        }
    }

    pub fn with_description(mut self, description: impl Into<String>) -> Self {
        self.description = Some(description.into());
        self
    }
}