spongefish_circuit/
error.rs1use alloc::string::String;
4use core::fmt;
5
6#[derive(Clone, Debug, PartialEq, Eq)]
13pub struct InvalidRelation {
14 message: String,
15}
16
17impl InvalidRelation {
18 pub(crate) fn new(message: impl Into<String>) -> Self {
19 Self {
20 message: message.into(),
21 }
22 }
23
24 pub fn message(&self) -> &str {
26 &self.message
27 }
28}
29
30impl fmt::Display for InvalidRelation {
31 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
32 write!(f, "invalid relation: {}", self.message)
33 }
34}
35
36impl core::error::Error for InvalidRelation {}