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
#[cfg(feature = "validator")]
pub fn is_alphanumeric(value: &str) -> Result<(), validator::ValidationError> {
    if value.chars().all(|c| c.is_alphanumeric()) {
        Ok(())
    } else {
        Err(validator::ValidationError::new("must be alphanumeric"))
    }
}