wolf-graph 0.1.0

Data structures and algorithms for working with graphs with reference or value semantics.
Documentation
use thiserror::Error;

use crate::{EdgeID, NodeID};

/// Error type for graph operations.
#[derive(Debug, Error)]
pub enum Error {
    #[error("node not found: {0}")]
    NodeNotFound(NodeID),
    #[error("edge not found: {0}")]
    EdgeNotFound(EdgeID),
    #[error("duplicate node: {0}")]
    DuplicateNode(NodeID),
    #[error("duplicate edge: {0}")]
    DuplicateEdge(EdgeID),
    #[error("not a DAG")]
    NotADAG,
    #[error("not a tree")]
    NotATree,
    #[error("not a compound")]
    NotACompound,
}