pub type DataType<const N: usize> = Option<[u8; N]>;
Expand description
DataType
is a type alias for an optional fixed-size array of u8
bytes.
This type represents an optional key where the key is an array of u8
of a fixed size,
defined by the constant generic parameter N
. If the key is not present, the type
will be None
, otherwise, it will contain the key as an array of bytes.
The fixed size of the key is determined at compile time by the N
constant, allowing
different key sizes to be handled dynamically with a single type alias.
§Example:
// DataType with a key of length 4 bytes
let key: DataType<4> = Some([1, 2, 3, 4]);
§Fields:
Some([u8; N])
: Contains a fixed-size array ofu8
bytes representing the key.None
: Indicates that the key is not present.
§Type Parameters:
N
: The fixed length of the key array (i.e., the number ofu8
bytes in the key).
§Traits Implemented:
- Implements
Option
, meaning it can beSome
containing a key orNone
for a missing key.
Aliased Type§
enum DataType<const N: usize> {
None,
Some([u8; N]),
}