email_pass

Email and Password Type in Rust

Include:

Safe Email Constructor

rust let correct_email = Email::new("example@example.com"); let incorrect_email = Email::new("example.com"); assert!(correct_email.is_ok()); assert!(incorrect_email.is_err());

Safe Passwords Constructor

```rust let unsafepassword = Password::new(NonEmptyString::tryfrom("01234").unwrap()); let safepassword = Password::new( NonEmptyString::tryfrom("ThisIsAPassPhrase.An.A.Secure.Password").unwrap(), );

assert!(unsafe_password.is_err());
assert!(safe_password.is_ok();

```

After initialization, you can't access the non encrypt value ```rust let mut password = Password::fromraw(NonEmptyString::tryfrom("01234").unwrap()); assert!(password.maybestring.isnone());

password.encrypt_password().unwrap();
assert!(password.maybe_string.is_some());

```