pub struct ReadCost {
pub depth: u32,
pub inflated: u64,
pub external_base: bool,
}Expand description
What one read actually cost, measured by the read rather than predicted.
The whole point of carrying it: the cache admission decision needs to know
whether an object was expensive to produce, and the reader that just
produced it is the only thing in the system that knows for certain. The
index could carry a depth column instead — git’s .idx does not, but the
walk computes one — and it would still be a prediction of what a read will
cost, while this is the bill.
Fields§
§depth: u32Delta links followed. 0 is a whole object: one inflate of one zlib
stream at one offset, which is what makes a direct read cheap enough
that caching it would be a waste of somebody’s quota.
inflated: u64Bytes the chain produced.
external_base: boolThe chain bottomed out on an object this archive does not hold, so a
BaseSource paid for it. Rare, and never cheap.
Trait Implementations§
impl Copy for ReadCost
impl Eq for ReadCost
impl StructuralPartialEq for ReadCost
Auto Trait Implementations§
impl Freeze for ReadCost
impl RefUnwindSafe for ReadCost
impl Send for ReadCost
impl Sync for ReadCost
impl Unpin for ReadCost
impl UnsafeUnpin for ReadCost
impl UnwindSafe for ReadCost
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.