Module traits

Module traits 

Source
Expand description

Defines commonly used traits across the entire code base.

Traits§

AsUnixTimestamp
A trait that’s added an extension method to represent a time object as Duration since Unix epoch.
BytesEncodable
Represents a type that can be encoded to/decoded from a fixed-sized byte array of size N.
BytesRepresentable
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.
IntoEndian
Extension trait for fixed size numbers to allow conversion to/from endian representations.
SaturatingSub
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.
UnitaryFloatOps
Allows type to be multiplied and divided by a float in range [0.0, 1.0].