btree_range_map/range/from_excluded.rs
1use std::ops::{Bound, RangeBounds};
2
3/// Range with only an start bound, excluded.
4pub struct RangeFromExcluded<T> {
5 pub start: T,
6}
7
8impl<T> RangeFromExcluded<T> {
9 pub const fn new(start: T) -> RangeFromExcluded<T> {
10 RangeFromExcluded { start }
11 }
12}
13
14impl<T> RangeBounds<T> for RangeFromExcluded<T> {
15 fn start_bound(&self) -> Bound<&T> {
16 Bound::Excluded(&self.start)
17 }
18
19 fn end_bound(&self) -> Bound<&T> {
20 Bound::Unbounded
21 }
22}