jns42-lib 0.1.1

Support for code generated by JsonSchema42
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[derive(Clone, Debug, PartialEq, PartialOrd, Eq, Ord)]
pub struct ValidationError {
  r#type: &'static str,
}

impl std::error::Error for ValidationError {}

impl ValidationError {
  pub fn new(r#type: &'static str) -> Self {
    Self { r#type }
  }
}

impl core::fmt::Display for ValidationError {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    write!(f, "validation error for type {}", self.r#type)
  }
}