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- AStringrepresenting the username to be validated.
§Returns
Result<bool, ContractError>- ReturnsOk(true)if the username is valid, otherwise returns anErrwith aContractErrordetailing the reason for invalidity.
§Examples