kcode-server-object-envelopes 0.1.0

Typed application payload envelopes stored by KennedyServer in Kweb objects
Documentation
use std::fmt;

/// A rejected envelope input or invalid stored payload.
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Error {
    message: String,
}

/// Result type for envelope operations.
pub type Result<T> = std::result::Result<T, Error>;

impl Error {
    pub(crate) fn new(message: impl Into<String>) -> Self {
        Self {
            message: message.into(),
        }
    }
}

impl fmt::Display for Error {
    fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
        formatter.write_str(&self.message)
    }
}

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