#[derive(Clone, Debug, Eq, PartialEq)]
pub struct ArcInfo<I, A> {
pub tail: I,
pub head: I,
pub attributes: A,
}
impl<I, A> ArcInfo<I, A> {
pub fn new(tail: I, head: I, attributes: A) -> Self {
Self {
tail,
head,
attributes,
}
}
pub fn head(&self) -> &I {
&self.head
}
pub fn tail(&self) -> &I {
&self.tail
}
pub fn attributes(&self) -> &A {
&self.attributes
}
}
impl<I, A> From<(I, I, A)> for ArcInfo<I, A> {
fn from(val: (I, I, A)) -> Self {
ArcInfo::new(val.0, val.1, val.2)
}
}
impl<I> From<(I, I)> for ArcInfo<I, ()> {
fn from(val: (I, I)) -> Self {
ArcInfo::new(val.0, val.1, ())
}
}