enigma-packet 0.1.0

Canonical message packet format + serialization for Enigma secure messaging
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use thiserror::Error;

pub type Result<T> = std::result::Result<T, EnigmaPacketError>;

#[derive(Debug, Error)]
pub enum EnigmaPacketError {
    #[error("invalid packet: {0}")]
    InvalidPacket(String),
    #[error("unsupported version {0}")]
    UnsupportedVersion(u8),
    #[error("size limit exceeded")]
    SizeLimitExceeded,
    #[error("decode error: {0}")]
    DecodeError(String),
    #[error("validation error: {0}")]
    ValidationError(String),
}