MeteredBytes

Trait MeteredBytes 

Source
pub trait MeteredBytes {
    // Required method
    fn metered_bytes(&self) -> u64;
}
Expand description

Metered size of the object in bytes.

Bytes are calculated using the “metered bytes” formula:

metered_bytes = lambda record: 8 + 2 * len(record.headers) + sum((len(h.key) + len(h.value)) for h in record.headers) + len(record.body)

Required Methods§

Source

fn metered_bytes(&self) -> u64

Return the metered bytes of the object.

Implementations on Foreign Types§

Source§

impl<T: MeteredBytes> MeteredBytes for Vec<T>

Implementors§