From 51a9e6114d64f90b5f1401944f76691d51130c50 Mon Sep 17 00:00:00 2001 From: Flier Lu Date: Fri, 8 Mar 2019 15:22:00 +0800 Subject: [PATCH] bind traits for Bytes --- src/ops/bytes.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/ops/bytes.rs b/src/ops/bytes.rs index 802f0cf..9ceddb5 100644 --- a/src/ops/bytes.rs +++ b/src/ops/bytes.rs @@ -1,7 +1,21 @@ +use core::borrow::{Borrow, BorrowMut}; +use core::cmp::{Eq, Ord, PartialEq, PartialOrd}; +use core::fmt::Debug; +use core::hash::Hash; use core::mem::transmute; pub trait IntToFromBytes { - type Bytes; + type Bytes: Debug + + AsRef<[u8]> + + AsMut<[u8]> + + PartialEq + + Eq + + PartialOrd + + Ord + + Hash + + Borrow<[u8]> + + BorrowMut<[u8]> + + Default; /// Return the memory representation of this integer as a byte array in big-endian byte order. ///