use std::fmt;
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum BondKind {
Elided,
Single,
Double,
Triple,
Quadruple,
Aromatic,
Up,
Down,
}
impl BondKind {
pub const fn reverse(&self) -> Self {
match self {
Self::Elided => Self::Elided,
Self::Single => Self::Single,
Self::Double => Self::Double,
Self::Triple => Self::Triple,
Self::Quadruple => Self::Quadruple,
Self::Aromatic => Self::Aromatic,
Self::Up => Self::Down,
Self::Down => Self::Up,
}
}
}
impl fmt::Display for BondKind {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::Elided => write!(f, ""),
Self::Single => write!(f, "-"),
Self::Double => write!(f, "="),
Self::Triple => write!(f, "#"),
Self::Quadruple => write!(f, "$"),
Self::Up => write!(f, "/"),
Self::Down => write!(f, "\\"),
Self::Aromatic => write!(f, ":"),
}
}
}