use miette::Diagnostic;
use std::fmt::Debug;
use std::fmt::Display;
use thiserror::Error;
#[derive(Debug, Diagnostic, Error, PartialEq, Eq)]
pub enum TcError<K: Debug + Display> {
#[error("expected all transitive edges to exist, but `{child}` -> `{parent}` and `{parent}` -> `{grandparent}` exists, while `{child}` -> `{grandparent}` does not")]
MissingTcEdge {
child: K,
parent: K,
grandparent: K,
},
#[error("input graph has a cycle containing vertex `{}`", .vertex_with_loop)]
HasCycle {
vertex_with_loop: K,
},
}
pub type Result<T, K> = std::result::Result<T, TcError<K>>;