Trait Packable

Source
pub trait Packable {
    // Required method
    fn pack<T>(&self, buf: &mut T) -> usize
       where T: Extend<u8>;

    // Provided method
    fn pack_to_vec(&self) -> Vec<u8>  { ... }
}
Expand description

A packable type.

Required Methods§

Source

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Pack a value into the extendable buffer, returning the amount of written bytes.

Provided Methods§

Source

fn pack_to_vec(&self) -> Vec<u8>

Packs the value into a vector of bytes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Packable for bool

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for f32

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for f64

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for i8

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for i16

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for i32

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for i64

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for i128

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for isize

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for str

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for u8

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for u16

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for u32

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for u64

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for u128

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for ()

Source§

fn pack<T>(&self, _buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for usize

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for String

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for Vec<u8>

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl Packable for [u8]

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<A> Packable for (A,)
where A: Packable,

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B> Packable for (A, B)
where A: Packable, B: Packable,

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C> Packable for (A, B, C)
where A: Packable, B: Packable, C: Packable,

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D> Packable for (A, B, C, D)
where A: Packable, B: Packable, C: Packable, D: Packable,

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E> Packable for (A, B, C, D, E)
where A: Packable, B: Packable, C: Packable, D: Packable, E: Packable,

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F> Packable for (A, B, C, D, E, F)
where A: Packable, B: Packable, C: Packable, D: Packable, E: Packable, F: Packable,

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G> Packable for (A, B, C, D, E, F, G)
where A: Packable, B: Packable, C: Packable, D: Packable, E: Packable, F: Packable, G: Packable,

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H> Packable for (A, B, C, D, E, F, G, H)
where A: Packable, B: Packable, C: Packable, D: Packable, E: Packable, F: Packable, G: Packable, H: Packable,

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I> Packable for (A, B, C, D, E, F, G, H, I)
where A: Packable, B: Packable, C: Packable, D: Packable, E: Packable, F: Packable, G: Packable, H: Packable, I: Packable,

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J> Packable for (A, B, C, D, E, F, G, H, I, J)
where A: Packable, B: Packable, C: Packable, D: Packable, E: Packable, F: Packable, G: Packable, H: Packable, I: Packable, J: Packable,

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

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

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

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

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M> Packable for (A, B, C, D, E, F, G, H, I, J, K, L, M)
where A: Packable, B: Packable, C: Packable, D: Packable, E: Packable, F: Packable, G: Packable, H: Packable, I: Packable, J: Packable, K: Packable, L: Packable, M: Packable,

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N> Packable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)
where A: Packable, B: Packable, C: Packable, D: Packable, E: Packable, F: Packable, G: Packable, H: Packable, I: Packable, J: Packable, K: Packable, L: Packable, M: Packable, N: Packable,

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> Packable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)
where A: Packable, B: Packable, C: Packable, D: Packable, E: Packable, F: Packable, G: Packable, H: Packable, I: Packable, J: Packable, K: Packable, L: Packable, M: Packable, N: Packable, O: Packable,

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> Packable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q> Packable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R> Packable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S> Packable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T> Packable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U> Packable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V> Packable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W> Packable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W)

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X> Packable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X)

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y> Packable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y)

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> Packable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

fn pack<TT>(&self, buf: &mut TT) -> usize
where TT: Extend<u8>,

Source§

impl<K, V> Packable for BTreeMap<K, V>
where K: Packable, V: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<K, V> Packable for HashMap<K, V>
where K: Packable, V: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for Option<X>
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 0]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 1]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 2]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 3]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 4]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 5]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 6]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 7]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 8]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 9]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 10]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 11]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 12]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 13]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 14]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 15]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 16]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 17]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 18]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 19]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 20]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 21]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 22]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 23]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 24]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 25]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 26]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 27]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 28]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 29]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 30]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 31]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 32]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 33]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 34]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 35]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 36]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 37]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 38]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 39]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 40]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 41]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 42]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 43]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 44]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 45]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 46]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 47]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 48]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 49]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 50]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 51]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 52]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 53]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 54]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 55]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 56]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 57]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 58]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 59]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 60]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 61]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 62]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 63]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for [X; 64]
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for &X
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for &mut X
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for BinaryHeap<X>
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for BTreeSet<X>
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for LinkedList<X>
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for VecDeque<X>
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for PhantomData<X>

Source§

fn pack<T>(&self, _buf: &mut T) -> usize
where T: Extend<u8>,

Source§

impl<X> Packable for HashSet<X>
where X: Packable,

Source§

fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>,

Implementors§