c2pa-warc 0.1.0

C2PA manifest embedding for WARC web archive files (ISO 28500)
Documentation
use std::fmt;

#[derive(Debug)]
pub enum Error {
    NotFound,
    InvalidRecord(String),
    Io(std::io::Error),
}

impl fmt::Display for Error {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Self::NotFound => write!(f, "no C2PA manifest record found"),
            Self::InvalidRecord(s) => write!(f, "invalid WARC record: {s}"),
            Self::Io(e) => write!(f, "I/O error: {e}"),
        }
    }
}

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

impl From<std::io::Error> for Error {
    fn from(e: std::io::Error) -> Self {
        Self::Io(e)
    }
}