Expand description
Defines commonly used traits across the entire code base.
Traits§
- AsUnix
Timestamp - A trait that’s added an 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
. - Bytes
Representable - Represents a type 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 an 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].