compilation fixed

This commit is contained in:
Nikolay Volf
2016-04-20 18:02:17 +03:00
parent 59e18ad659
commit 3908ddf609
6 changed files with 126 additions and 58 deletions

View File

@@ -16,10 +16,12 @@
//! Binary representation of types
pub trait BinaryConvertable {
fn size(&self) -> usize;
pub struct BinaryConvertError;
fn to_bytes(buffer: &mut [u8]);
pub trait BinaryConvertable : Sized {
fn size(&self) -> Result<usize, BinaryConvertError>;
fn from_bytes(buffer: &[u8]) -> Self;
fn to_bytes(buffer: &mut [u8]) -> Result<(), BinaryConvertError>;
fn from_bytes(buffer: &[u8]) -> Result<Self, BinaryConvertError>;
}