strong 0.3.4

Strongly typed String
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[test]
fn first() {
    use strong::{validators::Email, Strong, StrongBuf, Validator};

    fn login(_email: &Strong<Email>, _password: &Strong<Password>) {}

    let email: StrongBuf<Email> = StrongBuf::<Email>::validate("a@example.com".into()).unwrap();
    let password: &Strong<Password> = Strong::<Password>::validate("b").unwrap();
    login(&email, password);

    enum Password {}
    impl Validator for Password {
        type Err = std::convert::Infallible;
    }
}