zksync_error/
documentation.rs

1//
2// AUTOGENERATED BASED ON A SET OF JSON FILES, DO NOT EDIT MANUALLY
3//
4use lazy_static::lazy_static;
5use zksync_error_description::ErrorHierarchy;
6lazy_static! {
7    pub static ref model: ErrorHierarchy = get_model();
8}
9fn get_model() -> ErrorHierarchy {
10    zksync_error_description::ErrorHierarchy::deserialize(include_str!(
11        "../resources/error-model-dump.json"
12    ))
13}
14#[derive(Debug)]
15pub enum DocumentationError {
16    IncompleteModel(String),
17}
18impl std::fmt::Display for DocumentationError {
19    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20        f.write_fmt(format_args!("{self:#?}"))
21    }
22}
23impl std::error::Error for DocumentationError {}
24pub trait Documented {
25    type Documentation;
26    fn get_documentation(&self) -> Result<Option<Self::Documentation>, DocumentationError>;
27}