#[derive(Clone, Copy, PartialEq, Debug)]
pub struct FillSettings {
pub (crate) step: f64,
pub (crate) fit_error: f64,
pub (crate) min_gap: Option<f64>
}
impl FillSettings {
pub fn with_step(self, new_step: f64) -> FillSettings {
let mut new_options = self;
new_options.step = new_step;
new_options
}
pub fn with_fit_error(self, new_fit_error: f64) -> FillSettings {
let mut new_options = self;
new_options.fit_error = new_fit_error;
new_options
}
pub fn with_min_gap(self, new_min_gap: Option<f64>) -> FillSettings {
let mut new_options = self;
new_options.min_gap = new_min_gap;
new_options
}
}
impl Default for FillSettings {
fn default() -> FillSettings {
FillSettings {
step: 2.0,
fit_error: 0.5,
min_gap: Some(5.0)
}
}
}