amebazii::types

Type Alias DataType

Source
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 of u8 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 of u8 bytes in the key).

§Traits Implemented:

  • Implements Option, meaning it can be Some containing a key or None for a missing key.

Aliased Type§

enum DataType<const N: usize> {
    None,
    Some([u8; N]),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some([u8; N])

Some value of type T.