Make versions of hal::as_bytes that enforce endianess without copying data if possible (ie span of bytes still). If not possible, then returning an array of N bytes where N is the size of the given payload. Similar to the current as_bytes but as an array instead of a span it would be an array.
If data is copied, name should be "to_le_bytes" or "to_be_bytes"
Make versions of hal::as_bytes that enforce endianess without copying data if possible (ie span of bytes still). If not possible, then returning an array of N bytes where N is the size of the given payload. Similar to the current as_bytes but as an array instead of a span it would be an array.
If data is copied, name should be "to_le_bytes" or "to_be_bytes"