Expand description
Defines commonly used traits across the entire code base.
Traitsยง
- AsUnix
Timestamp - A trait that adds extension method to represent a time object as
Duration
since Unix epoch. - Bytes
Encodable - Represents a type that can be encoded to/decoded from a fixed sized byte array of size
N
. This requires processing and memory allocation to represent the type in binary encoding. - Bytes
Representable - Represents a type that is already internally represented by a fixed size byte array, and therefore requires no memory allocation to represent the type in binary encoding.
- Into
Endian - Extension trait for fixed size numbers to allow conversion to/from endian representations.
- Saturating
Sub - A trait that adds extension method to perform saturated substractions on
SystemTime
instances. - ToHex
- A generic type that can be converted to a hexadecimal string.
- Unitary
Float Ops - Allows type to be multiplied and divided by a float in range [0.0, 1.0].