Skip to main content

slice_from_bytes

Function slice_from_bytes 

Source
pub fn slice_from_bytes<T: RawConvert>(bytes: &[u8]) -> Result<&[T], BrinyError>
Expand description

Attempts to get a slice from raw bytes.

ยงErrors

Instead of causing undefined behavior or panicking, this function returns an error when bytes is invalid (incorrect size or unaligned).