Skip to main content

datex_core/values/core_values/
range.rs

1use crate::values::value_container::ValueContainer;
2use alloc::boxed::Box;
3use core::fmt;
4
5#[derive(Clone, Eq, PartialEq, Hash)]
6pub struct Range {
7    // lower bound (inclusive)
8    pub start: Box<ValueContainer>,
9    // upper bound (exclusive)
10    pub end: Box<ValueContainer>,
11}
12
13impl fmt::Debug for Range {
14    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
15        core::write!(f, "{:?}..{:?}", self.start, self.end)
16    }
17}
18
19impl fmt::Display for Range {
20    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
21        core::write!(f, "{}..{}", self.start, self.end)
22    }
23}