php-dates 0.2.1

PHP date() patterns for Rust: strict createFromFormat-style parsing, a pattern resolution contract and a Day.js export, with no framework dependency
Documentation
use thiserror::Error;

/// A date pattern that cannot be used.
#[derive(Debug, Clone, PartialEq, Eq, Error)]
#[non_exhaustive]
pub enum Error {
    /// An empty pattern, a token this port does not support, or one Day.js cannot express.
    #[error("{0}")]
    InvalidFormat(String),
}

impl Error {
    pub(crate) fn argument(reason: impl Into<String>) -> Self {
        Self::InvalidFormat(reason.into())
    }
}

/// A date pattern that failed validation.
pub type Result<T> = std::result::Result<T, Error>;