Trait kernel::io_buffer::ReadableFromBytes
source · [−]pub unsafe trait ReadableFromBytes { }
Expand description
Specifies that a type is safely readable from byte slices.
Not all types can be safely read from byte slices; examples from
https://doc.rust-lang.org/reference/behavior-considered-undefined.html include bool
that must be either 0
or 1
, and char
that cannot be a surrogate or above char::MAX
.
Safety
Implementers must ensure that the type is made up only of types that can be safely read from
arbitrary byte sequences (e.g., u32
, u64
, etc.).