commit 4dd1a854bcf5b3c010dd6577fb84882532894634
parent 1260f427514333d961218b7f82b80803c70f0d76
Author: Jackson G. Kaindume <seestem@merely.tech>
Date: Sun, 21 Aug 2022 11:34:26 +0200
add accounts.rs
Diffstat:
1 file changed, 19 insertions(+), 0 deletions(-)
diff --git a/src/accounts.rs b/src/accounts.rs
@@ -0,0 +1,19 @@
+use crate::validator::Validator;
+
+/// An account that consists on of username, emails and password
+pub struct UsernameEmailPassword {
+ /// The username of the user, also used as an unique identifier
+ pub username: String,
+ /// The email address the user
+ email: String,
+ /// The password of the user
+ pub password: String,
+}
+
+impl UsernameEmailPassword {
+ pub fn new(username: &str, email: &str, password: &str) -> Result<(), ()> {
+ if Validator::username(username) {}
+
+ Ok(())
+ }
+}