[][src]Trait desert::CountBytes

pub trait CountBytes {
    fn count_from_bytes(buf: &[u8]) -> Result<usize, Error>;
fn count_bytes(&self) -> usize; fn count_from_bytes_more(buf: &[u8]) -> Result<Option<usize>, Error> { ... } }

Count how many bytes to read from a byte slice for a type and calculate how many bytes the serialization would contain. The implementations for the built-in types are in big endian for this trait.

Required methods

fn count_from_bytes(buf: &[u8]) -> Result<usize, Error>

Return how many bytes from buf would be required to deserialize Self.

fn count_bytes(&self) -> usize

Return the number of bytes that the serialization would require.

Loading content...

Provided methods

fn count_from_bytes_more(buf: &[u8]) -> Result<Option<usize>, Error>

Return how many bytes from buf would be required to deserialize Self, where if there are not enough bytes in buf to know how many bytes would be required, you will receive None or otherwise Some(nbytes).

Loading content...

Implementations on Foreign Types

impl CountBytes for u8[src]

impl CountBytes for u16[src]

impl CountBytes for u32[src]

impl CountBytes for u64[src]

impl CountBytes for u128[src]

impl CountBytes for i8[src]

impl CountBytes for i16[src]

impl CountBytes for i32[src]

impl CountBytes for i64[src]

impl CountBytes for i128[src]

impl CountBytes for f32[src]

impl CountBytes for f64[src]

impl CountBytes for bool[src]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading content...

Implementors

Loading content...