sequential_integration/engine/bounds.rs
1use fehler::throws;
2use snafu::ensure;
3
4use crate::errors::{self, Error};
5
6#[derive(Copy, Clone)]
7pub struct Bounds {
8 pub begin: f64,
9 pub end: f64,
10}
11
12impl Bounds {
13 #[throws]
14 pub fn new(begin: f64, end: f64) -> Self {
15 ensure!(
16 begin <= end,
17 errors::BeginBoundGreaterThanEndBound { begin, end }
18 );
19
20 Self { begin, end }
21 }
22}