p2sh 0.4.3

The p2sh Programming language interpreter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::fmt;

#[derive(Debug)]
pub enum PacketError {
    InvalidLength(usize),
    InvalidMacAddress,
}

impl fmt::Display for PacketError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match &self {
            Self::InvalidLength(len) => write!(f, "invalid-length: {len}"),
            Self::InvalidMacAddress => write!(f, "invalid-mac-address"),
        }
    }
}