use std::{
cmp::{max, min},
ops::Range,
};
use std::fmt::{Display, Formatter};
pub mod actions;
pub mod typed_edges;
mod simple;
pub mod mut_iter;
pub type EdgeID = usize;
pub trait Edge: Display {
fn direction(&self) -> EdgeDirection;
fn lhs(&self) -> usize;
fn rhs(&self) -> usize;
fn max_index(&self) -> usize {
max(self.lhs(), self.rhs())
}
fn min_index(&self) -> usize {
min(self.lhs(), self.rhs())
}
fn delta_index(&self) -> usize {
self.max_index() - self.min_index()
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum EdgeDirection {
Disconnect,
Indeterminate,
TwoWay,
Forward,
Reverse,
}