[][src]Trait desert::ToBytes

pub trait ToBytes {
    fn to_bytes(&self) -> Result<Vec<u8>, Error>;

    fn write_bytes(&self, dst: &mut [u8]) -> Result<usize, Error> { ... }
}

Serialize a type into a sequence of bytes with unspecified endianness. The implementations for the built-in types are in big endian for this trait.

Required methods

fn to_bytes(&self) -> Result<Vec<u8>, Error>

Serialize into a newly-allocated byte vector.

Loading content...

Provided methods

fn write_bytes(&self, dst: &mut [u8]) -> Result<usize, Error>

Serialize into an existing mutable byte slice. The usize Result contains how many bytes were written to dst.

Loading content...

Implementations on Foreign Types

impl ToBytes for u8[src]

impl ToBytes for u16[src]

impl ToBytes for u32[src]

impl ToBytes for u64[src]

impl ToBytes for u128[src]

impl ToBytes for i8[src]

impl ToBytes for i16[src]

impl ToBytes for i32[src]

impl ToBytes for i64[src]

impl ToBytes for i128[src]

impl ToBytes for f32[src]

impl ToBytes for f64[src]

impl ToBytes for bool[src]

impl<A, B> ToBytes for (A, B) where
    A: ToBytes + CountBytes,
    B: ToBytes + CountBytes
[src]

impl<A, B, C> ToBytes for (A, B, C) where
    A: ToBytes + CountBytes,
    B: ToBytes + CountBytes,
    C: ToBytes + CountBytes
[src]

impl<A, B, C, D> ToBytes for (A, B, C, D) where
    A: ToBytes + CountBytes,
    B: ToBytes + CountBytes,
    C: ToBytes + CountBytes,
    D: ToBytes + CountBytes
[src]

impl<A, B, C, D, E> ToBytes for (A, B, C, D, E) where
    A: ToBytes + CountBytes,
    B: ToBytes + CountBytes,
    C: ToBytes + CountBytes,
    D: ToBytes + CountBytes,
    E: ToBytes + CountBytes
[src]

impl<A, B, C, D, E, F> ToBytes for (A, B, C, D, E, F) where
    A: ToBytes + CountBytes,
    B: ToBytes + CountBytes,
    C: ToBytes + CountBytes,
    D: ToBytes + CountBytes,
    E: ToBytes + CountBytes,
    F: ToBytes + CountBytes
[src]

impl<A, B, C, D, E, F, G> ToBytes for (A, B, C, D, E, F, G) where
    A: ToBytes + CountBytes,
    B: ToBytes + CountBytes,
    C: ToBytes + CountBytes,
    D: ToBytes + CountBytes,
    E: ToBytes + CountBytes,
    F: ToBytes + CountBytes,
    G: ToBytes + CountBytes
[src]

impl<A, B, C, D, E, F, G, H> ToBytes for (A, B, C, D, E, F, G, H) where
    A: ToBytes + CountBytes,
    B: ToBytes + CountBytes,
    C: ToBytes + CountBytes,
    D: ToBytes + CountBytes,
    E: ToBytes + CountBytes,
    F: ToBytes + CountBytes,
    G: ToBytes + CountBytes,
    H: ToBytes + CountBytes
[src]

impl<A, B, C, D, E, F, G, H, I> ToBytes for (A, B, C, D, E, F, G, H, I) where
    A: ToBytes + CountBytes,
    B: ToBytes + CountBytes,
    C: ToBytes + CountBytes,
    D: ToBytes + CountBytes,
    E: ToBytes + CountBytes,
    F: ToBytes + CountBytes,
    G: ToBytes + CountBytes,
    H: ToBytes + CountBytes,
    I: ToBytes + CountBytes
[src]

impl<A, B, C, D, E, F, G, H, I, J> ToBytes for (A, B, C, D, E, F, G, H, I, J) where
    A: ToBytes + CountBytes,
    B: ToBytes + CountBytes,
    C: ToBytes + CountBytes,
    D: ToBytes + CountBytes,
    E: ToBytes + CountBytes,
    F: ToBytes + CountBytes,
    G: ToBytes + CountBytes,
    H: ToBytes + CountBytes,
    I: ToBytes + CountBytes,
    J: ToBytes + CountBytes
[src]

impl<A, B, C, D, E, F, G, H, I, J, K> ToBytes for (A, B, C, D, E, F, G, H, I, J, K) where
    A: ToBytes + CountBytes,
    B: ToBytes + CountBytes,
    C: ToBytes + CountBytes,
    D: ToBytes + CountBytes,
    E: ToBytes + CountBytes,
    F: ToBytes + CountBytes,
    G: ToBytes + CountBytes,
    H: ToBytes + CountBytes,
    I: ToBytes + CountBytes,
    J: ToBytes + CountBytes,
    K: ToBytes + CountBytes
[src]

impl<A, B, C, D, E, F, G, H, I, J, K, L> ToBytes for (A, B, C, D, E, F, G, H, I, J, K, L) where
    A: ToBytes + CountBytes,
    B: ToBytes + CountBytes,
    C: ToBytes + CountBytes,
    D: ToBytes + CountBytes,
    E: ToBytes + CountBytes,
    F: ToBytes + CountBytes,
    G: ToBytes + CountBytes,
    H: ToBytes + CountBytes,
    I: ToBytes + CountBytes,
    J: ToBytes + CountBytes,
    K: ToBytes + CountBytes,
    L: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 1] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 2] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 3] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 4] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 5] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 6] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 7] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 8] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 9] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 10] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 11] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 12] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 13] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 14] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 15] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 16] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 17] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 18] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 19] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 20] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 21] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 22] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 23] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 24] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 25] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 26] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 27] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 28] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 29] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 30] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 31] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 32] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 33] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 34] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 35] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 36] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 37] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 38] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 39] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 40] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 41] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 42] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 43] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 44] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 45] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 46] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 47] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 48] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 49] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 50] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 51] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 52] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 53] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 54] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 55] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 56] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 57] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 58] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 59] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 60] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 61] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 62] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 63] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 64] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 65] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 66] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 67] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 68] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 69] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 70] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 71] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 72] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 73] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 74] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 75] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 76] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 77] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 78] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 79] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 80] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 81] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 82] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 83] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 84] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 85] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 86] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 87] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 88] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 89] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 90] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 91] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 92] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 93] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 94] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 95] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 96] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 97] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 98] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 99] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 100] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 128] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 256] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 512] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 1024] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 2048] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 4096] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 8192] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 16384] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 32768] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T; 65536] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for [T] where
    T: ToBytes + CountBytes
[src]

impl<T> ToBytes for Vec<T> where
    T: ToBytes + CountBytes
[src]

Loading content...

Implementors

Loading content...