1 | pub trait BincodeByteOrder {
|
2 | type Endian: ::byteorder::ByteOrder + 'static;
|
3 | }
|
4 |
|
5 | /// Little-endian byte ordering.
|
6 | #[derive (Copy, Clone)]
|
7 | pub struct LittleEndian;
|
8 |
|
9 | /// Big-endian byte ordering.
|
10 | #[derive (Copy, Clone)]
|
11 | pub struct BigEndian;
|
12 |
|
13 | /// The native byte ordering of the current system.
|
14 | #[derive (Copy, Clone)]
|
15 | pub struct NativeEndian;
|
16 |
|
17 | impl BincodeByteOrder for LittleEndian {
|
18 | type Endian = ::byteorder::LittleEndian;
|
19 | }
|
20 |
|
21 | impl BincodeByteOrder for BigEndian {
|
22 | type Endian = ::byteorder::BigEndian;
|
23 | }
|
24 |
|
25 | impl BincodeByteOrder for NativeEndian {
|
26 | type Endian = ::byteorder::NativeEndian;
|
27 | }
|
28 | |