EncodeSize

Trait EncodeSize 

Source
pub trait EncodeSize {
    // Required method
    fn encode_size(&self) -> usize;
}
Expand description

Trait for types that can provide their encoded size in bytes.

This must be implemented by all encodable types. For types implementing FixedSize, this trait is implemented automatically. For variable-size types, this requires calculating the size based on the value.

Required Methods§

Source

fn encode_size(&self) -> usize

Returns the encoded size of this value (in bytes).

Implementations on Foreign Types§

Source§

impl EncodeSize for SocketAddr

Source§

impl EncodeSize for usize

Source§

impl EncodeSize for Bytes

Source§

impl<K: Ord + Hash + Eq + EncodeSize> EncodeSize for BTreeSet<K>

Source§

impl<K: Ord + Hash + Eq + EncodeSize> EncodeSize for HashSet<K>

Source§

impl<K: Ord + Hash + Eq + EncodeSize, V: EncodeSize> EncodeSize for BTreeMap<K, V>

Source§

impl<K: Ord + Hash + Eq + EncodeSize, V: EncodeSize> EncodeSize for HashMap<K, V>

Source§

impl<T0: EncodeSize> EncodeSize for (T0,)

Source§

impl<T0: EncodeSize, T1: EncodeSize> EncodeSize for (T0, T1)

Source§

impl<T0: EncodeSize, T1: EncodeSize, T2: EncodeSize> EncodeSize for (T0, T1, T2)

Source§

impl<T0: EncodeSize, T1: EncodeSize, T2: EncodeSize, T3: EncodeSize> EncodeSize for (T0, T1, T2, T3)

Source§

impl<T0: EncodeSize, T1: EncodeSize, T2: EncodeSize, T3: EncodeSize, T4: EncodeSize> EncodeSize for (T0, T1, T2, T3, T4)

Source§

impl<T0: EncodeSize, T1: EncodeSize, T2: EncodeSize, T3: EncodeSize, T4: EncodeSize, T5: EncodeSize> EncodeSize for (T0, T1, T2, T3, T4, T5)

Source§

impl<T0: EncodeSize, T1: EncodeSize, T2: EncodeSize, T3: EncodeSize, T4: EncodeSize, T5: EncodeSize, T6: EncodeSize> EncodeSize for (T0, T1, T2, T3, T4, T5, T6)

Source§

impl<T0: EncodeSize, T1: EncodeSize, T2: EncodeSize, T3: EncodeSize, T4: EncodeSize, T5: EncodeSize, T6: EncodeSize, T7: EncodeSize> EncodeSize for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T0: EncodeSize, T1: EncodeSize, T2: EncodeSize, T3: EncodeSize, T4: EncodeSize, T5: EncodeSize, T6: EncodeSize, T7: EncodeSize, T8: EncodeSize> EncodeSize for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T0: EncodeSize, T1: EncodeSize, T2: EncodeSize, T3: EncodeSize, T4: EncodeSize, T5: EncodeSize, T6: EncodeSize, T7: EncodeSize, T8: EncodeSize, T9: EncodeSize> EncodeSize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

impl<T0: EncodeSize, T1: EncodeSize, T2: EncodeSize, T3: EncodeSize, T4: EncodeSize, T5: EncodeSize, T6: EncodeSize, T7: EncodeSize, T8: EncodeSize, T9: EncodeSize, T10: EncodeSize> EncodeSize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Source§

impl<T0: EncodeSize, T1: EncodeSize, T2: EncodeSize, T3: EncodeSize, T4: EncodeSize, T5: EncodeSize, T6: EncodeSize, T7: EncodeSize, T8: EncodeSize, T9: EncodeSize, T10: EncodeSize, T11: EncodeSize> EncodeSize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

Source§

impl<T: EncodeSize> EncodeSize for Option<T>

Source§

impl<T: EncodeSize> EncodeSize for Vec<T>

Implementors§

Source§

impl<S: SPrim> EncodeSize for SInt<S>

Source§

impl<T: FixedSize> EncodeSize for T

Source§

impl<U: UPrim> EncodeSize for UInt<U>