from_bytes

Function from_bytes 

Source
pub fn from_bytes<T>(bytes: &[u8]) -> Result<T, Error>
where T: FromBytes,
Expand description

Converts a byte vector to a value.

ยงExamples

use fdb_tuple::{to_bytes, from_bytes};

let bytes = to_bytes(("a", "b"));
assert_eq!(bytes, b"\x02a\x00\x02b\x00");

let tuple: (String, String) = from_bytes(&bytes).unwrap();
assert_eq!(tuple, ("a".to_string(), "b".to_string()));