pub fn read_i64(buf: &[u8]) -> Result<i64, CopyReadError>Expand description
Reads an i64 value from HyperBinary format (LittleEndian).
§Errors
Returns CopyReadError::BufferTooShort if the buffer is too short (< 8 bytes).
§Example
use hyperdb_api_core::protocol::copy::{read_i64, CopyReadError};
let buf = [0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01];
assert_eq!(read_i64(&buf).unwrap(), 0x0102030405060708);
let short_buf = [0x08, 0x07, 0x06, 0x05];
assert!(matches!(read_i64(&short_buf), Err(CopyReadError::BufferTooShort { .. })));