Skip to main content

Module byte_slice

Module byte_slice 

Source
Expand description

Parsing an unsigned integer from a byte slice of arbitrary length.

The input &[u8] need not match the target’s byte width: shorter input zero-extends, equal is exact, wider is rejected rather than truncated. That reject case is why the parse returns a Result — an over-long slice has no lossless reading.

Unsigned-only: zero-extension is unambiguous for magnitudes but has no sign-extension analogue, so signed targets are deliberately excluded.

CT tier A (structure-only) for a fixed-length input: control flow branches only on bytes.len() (emptiness, over-width), never on byte values, so a constant-length caller is constant-time.

Structs§

ByteSliceError
Error parsing an integer from a byte slice.

Enums§

ByteSliceErrorKind
The reason a FromByteSlice parse failed.

Traits§

FromByteSlice
Parses an unsigned integer from a byte slice of arbitrary length.