kutil_http/cache/
weight.rs

1//
2// CacheWeight
3//
4
5/// Cache weight.
6pub trait CacheWeight {
7    /// Cache weight as a byte count.
8    ///
9    /// It is *not* the amount of memory used, but rather an indicator of *potential* storage
10    /// requirements.
11    ///
12    /// Its intended use is for apples-to-apples comparisons, e.g. to find out which of two items
13    /// of the same type weighs more. But even then it may be misleading in some cases, e.g. if
14    /// storage involves compression then the "heavier" item might end up taking less storage then
15    /// the "lighter" item.
16    ///
17    /// Note that *sums* of weights can be especially misleading in terms of memory use because
18    /// there might be memory shared between items, e.g. via the use of [Bytes](bytes::Bytes).
19    fn cache_weight(&self) -> usize;
20}