torrust-index 3.0.0

A BitTorrent Index
Documentation
use serde::Serialize;

#[derive(Clone, Serialize)]
pub struct RegistrationForm {
    pub username: String,
    pub email: Option<String>,
    pub password: String,
    pub confirm_password: String,
}

pub type RegisteredUser = RegistrationForm;

#[derive(Serialize)]
pub struct LoginForm {
    pub login: String,
    pub password: String,
}

#[derive(Serialize)]
pub struct TokenVerificationForm {
    pub token: String,
}

#[derive(Serialize)]
pub struct TokenRenewalForm {
    pub token: String,
}

pub struct Username {
    pub value: String,
}

impl Username {
    #[must_use]
    pub fn new(value: String) -> Self {
        Self { value }
    }
}