decon-spf 0.3.3

This is a simple tool that allows you to deconstruct an existing SPF record that might be retreived in a normal DNS TXT lookup. With version 0.2.0 you can now also construct a new Spf record.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod parse {

    use crate::SpfBuilder;

    #[test]
    fn valid() {
        let input = "v=spf1 ip6:2001:4860:4000::/36 ~all";

        let spf: SpfBuilder<_> = input.parse().unwrap();
        assert!(spf.ip6().is_some());
        assert_eq!(spf.ip6().unwrap()[0].qualifier().is_pass(), true);
        assert_eq!(spf.ip6().unwrap()[0].raw(), "2001:4860:4000::/36");
        assert_eq!(spf.ip6().unwrap()[0].to_string(), "ip6:2001:4860:4000::/36");
    }
    mod invalid {
        // Need failing tests
    }
}