byte-sequence 0.1.0

A little marco that creates structs to be used as byte sequences (for ApiKeys, SessionIds and so on)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
error_chain! {
    errors {
        InvalidKeyLen(raw_key: String, typename: &'static str) {
            description("Failed to convert string to key because it had the wrong length")
            display("Failed to convert '{}' to '{}' because it had the wrong length", raw_key, typename)
        }
        InvalidKeyChars(raw_key: String, typename: &'static str) {
            description("Failed to convert string to key because it contained invalid characters")
            display("Failed to convert '{}' to '{}' because it contained invalid characters", raw_key, typename)
        }
    }
}