from_to_bytes 0.1.1

trait for convert between bytes and <T>.
Documentation
1
2
3
4
5
6
7
trait FromBytes: Sized {
    fn from_bytes(bytes: &[u8]) -> Result<Self, Box<dyn std::error::Error>>;
}

trait ToBytes {
    fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn std::error::Error>>;
}