encode method allocates a new string which is wasteful if all one
wants to do is display the binary data using format! or related macro.
Introduce hex::Display wrapper with hex::display as its constructor
which wraps the binary data in an object that implements Display,
LowerHex, UpperHex and Debug and formats the data as hex. However, as
it uses buffers on stack, it performs no allocations.
encode method allocates a new string which is wasteful if all one wants to do is display the binary data using format! or related macro.
Introduce hex::Display wrapper with hex::display as its constructor which wraps the binary data in an object that implements Display, LowerHex, UpperHex and Debug and formats the data as hex. However, as it uses buffers on stack, it performs no allocations.