pub struct PassBudget { /* private fields */ }Expand description
The work one garbage-collection pass is allowed to do.
One unit is one object the pass reads or decides on a candidate’s behalf:
- one enumerated candidate key, decided — the original meaning of
max_objects; - one manifest opened by the content reference scan;
- one page of revision rows read out of an opened manifest;
- one retained WAL segment fetched by the scan.
Prefix listing is the one thing not metered: it is how a family finds candidates at all, and the cursor is what resumes it. Everything else a pass touches is charged, so no pass can do work proportional to the namespace while asking for a small budget.
The rule is deliberately coarse — it is a bound, not a cost model. A page of rows costs more than a manifest header and both count as one. What matters is that every store round trip inside the pass has a charge attached to it, and that running out stops the pass instead of letting it finish “just this one thing” unboundedly.
Implementations§
Source§impl PassBudget
impl PassBudget
Sourcepub fn new(max_objects: Option<u64>) -> Self
pub fn new(max_objects: Option<u64>) -> Self
Meters a pass at max_objects units, or at nothing when absent.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PassBudget
impl RefUnwindSafe for PassBudget
impl Send for PassBudget
impl Sync for PassBudget
impl Unpin for PassBudget
impl UnsafeUnpin for PassBudget
impl UnwindSafe for PassBudget
Blanket Implementations§
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more