Byte Sequences
This crate provides some utility to create byte sequences like ApiKeys or SessionIds. It contains a macro that lets you specify the name and length in bytes of the sequence. The macro than creates a struct that has following methods
;
It also implements Display, Debug, serde::Serialize, serde::Deserialize, PartialOrd, Ord, PartialEq, Eq, Clone, Copy and Hash;
Complete example:
extern crate byte_sequence;
extern crate rand;
use serde;
use std;
use Checkable;
byte_seq!;
You can also extend the generated structs. For example add a public part of the ApiKey: