mod edge_type;
mod node;
mod pattern;
pub use edge_type::*;
pub use node::*;
pub use pattern::*;
use thiserror::Error;
#[derive(Debug, Error, Eq, PartialEq)]
/// Errors that can occur when working with a [Pattern]
pub enum PatternError {
#[error("Node index {0} exceeds the number of nodes in the pattern")]
/// An error that occurs when a node index exceeds the number of nodes in the [Pattern]
NodeIndexOutOfBounds(usize),
#[error("The pattern contains a cycle")]
/// An error that occurs when the [Pattern] contains a cycle
ContainsCycle,
}
/// A result type for operations on a [Pattern]
pub type Result<T> = std::result::Result<T, PatternError>;