Module tiff::bytecast

source ·
Expand description

Trivial, internal byte transmutation.

A dependency like bytemuck would give us extra assurance of the safety but overall would not reduce the amount of total unsafety. We don’t use it in the interface where the traits would really become useful.

SAFETY: These are benign casts as we apply them to fixed size integer types only. All of them are naturally aligned, valid for all bit patterns and their alignment is surely at most their size (we assert the latter fact since it is ‘implementation defined’ if following the letter of the unsafe code guidelines).

TODO: Would like to use std-lib here.

Macros§

Functions§