1use std::ops;
2
3pub trait Range<T> {
4 fn start(&self) -> Option<&T> {
5 None
6 }
7
8 fn end(&self) -> Option<&T> {
9 None
10 }
11}
12
13impl<T> Range<T> for ops::Range<T> {
14 fn start(&self) -> Option<&T> {
15 Some(&self.start)
16 }
17
18 fn end(&self) -> Option<&T> {
19 Some(&self.end)
20 }
21}
22
23impl<T> Range<T> for ops::RangeTo<T> {
24 fn end(&self) -> Option<&T> {
25 Some(&self.end)
26 }
27}
28
29impl<T> Range<T> for ops::RangeFrom<T> {
30 fn start(&self) -> Option<&T> {
31 Some(&self.start)
32 }
33}
34
35impl<T> Range<T> for ops::RangeFull {}
36