1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use std::ops::{BitOr, BitAnd};
use std::hash::{Hash, Hasher};
use super::ItemState;
#[derive(Debug, Clone, Eq)]
pub struct Segment<'a> {
pub left: ItemState<'a>,
pub right: ItemState<'a>,
}
impl <'a> From<(ItemState<'a>, ItemState<'a>)> for Segment <'a> {
fn from((left, right): (ItemState<'a>, ItemState<'a>)) -> Segment<'a> {
Segment {
left: left,
right: right,
}
}
}
impl <'a> Hash for Segment <'a> {
fn hash<H: Hasher>(&self, _: &mut H) {
}
}
impl <'a> PartialEq for Segment <'a> {
fn eq(&self, rhs: &Segment) -> bool {
self.left.eq(&rhs.left)
.bitand(self.right.eq(&rhs.right))
.bitor(self.left.eq(&rhs.right)
.bitand(self.right.eq(&rhs.left)))
}
}