giga-chess-api-types 0.1.0

A library providing shared types between giga-chess client and server.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[derive(Debug, Clone, Ord, PartialOrd, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[cfg_attr(feature = "validator", derive(validator::Validate))]
pub struct LoginBody {
    #[cfg_attr(
        feature = "validator",
        validate(
            length(min = 3, max = 50),
            custom(function = "crate::validation::alphanumeric::is_alphanumeric")
        )
    )]
    pub username: String,
    pub password: String,
}