1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use crate::no_std::*;
use core::{
    fmt::{Debug, Display},
    hash::Hash,
};

/// The interface for a generic format.
pub trait Format:
    Clone + Debug + Display + Send + Sync + 'static + Eq + Ord + Sized + Hash
{
}

#[derive(Debug, Error)]
pub enum FormatError {
    #[error("{0}: {1}")]
    Crate(&'static str, String),

    #[error("invalid address prefix: {0:?}")]
    InvalidPrefix(Vec<u8>),

    #[error("invalid version bytes: {0:?}")]
    InvalidVersionBytes(Vec<u8>),

    #[error("unsupported derivation path for the format: {0}")]
    UnsupportedDerivationPath(String),
}