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Β§
- f32_
as_ πne_ bytes - f32_
as_ πne_ mut_ bytes - f64_
as_ πne_ bytes - f64_
as_ πne_ mut_ bytes - i8_
as_ πne_ bytes - i8_
as_ πne_ mut_ bytes - i16_
as_ πne_ bytes - i16_
as_ πne_ mut_ bytes - i32_
as_ πne_ bytes - i32_
as_ πne_ mut_ bytes - i64_
as_ πne_ bytes - i64_
as_ πne_ mut_ bytes - u16_
as_ πne_ bytes - u16_
as_ πne_ mut_ bytes - u32_
as_ πne_ bytes - u32_
as_ πne_ mut_ bytes - u64_
as_ πne_ bytes - u64_
as_ πne_ mut_ bytes