confirm-email 0.1.1

A Rust crate for creating URL‑safe, encrypted email confirmation tokens with configurable expiry (with precision to the second) and for validating them to retrieve the original email.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use chrono::{DateTime, Utc};
use thiserror::Error;

#[derive(Error, Debug)]
/// Defines possible errors
pub enum Error {
    /// The Token is expired at the date
    #[error("token expired at `{0}`")]
    Expired(DateTime<Utc>),
    /// Unknown error
    #[error("error occurred: {0:?}")]
    Other(String),
}