1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//! `encdec` crate base traits

#![feature(negative_impls)]
#![feature(generic_associated_types)]
#![feature(array_try_from_fn)]

#![no_std]

mod encode;
pub use encode::*;

mod decode;
pub use decode::*;

mod error;
pub use error::Error;

mod primitives;

pub mod helpers;

/// Composite trait requiring an object is both encodable and decodable
pub trait EncDec<'a>: Encode + Decode<'a, Output=Self> {}

/// Automatic implementation for types implementing [`Encode`] and [`Decode`]
impl <'a, T: Encode + Decode<'a, Output=Self>> EncDec<'a> for T {}