pub fn validate_username(username: String) -> Result<bool, ContractError>
Expand description
Validates a username against specific criteria.
This function checks if a given username meets the following conditions:
- It must contain at least three characters
- It must only contain alphanumeric characters
§Arguments
username
- AString
representing the username to be validated.
§Returns
Result<bool, ContractError>
- ReturnsOk(true)
if the username is valid, otherwise returns anErr
with aContractError
detailing the reason for invalidity.
§Examples