pub(super) struct TotalQty {
raw: ByteQty,
}
Expand description
Total used, TotalQtyNotifier
.total_used
, found in State
.total_used
.
Can be “poisoned”, preventing further claims. (We mark it poisoned if the reclamation task crashes, since in that situation we don’t want to continue to use memory, unboundedly.)
Fields§
§raw: ByteQty
See BookkeptQty
Implementations§
Source§impl TotalQty
impl TotalQty
Sourcepub(super) fn claim(
&mut self,
p_used: &mut ParticipQty,
want: Qty,
) -> Option<ClaimedQty>
pub(super) fn claim( &mut self, p_used: &mut ParticipQty, want: Qty, ) -> Option<ClaimedQty>
Claim a quantity, increasing the tracked amounts
This module doesn’t know anything about the memory quota, so this doesn’t do the quota check.
The only caller is Participation::claim
.
Sourcepub(super) fn release(&mut self, p_used: &mut ParticipQty, have: ClaimedQty)
pub(super) fn release(&mut self, p_used: &mut ParticipQty, have: ClaimedQty)
Release a quantity, decreasing the tracked amounts
(Handles underflow by saturating; returning an error is not going to be useful.)
Sourcepub(super) fn set_poisoned(&mut self)
pub(super) fn set_poisoned(&mut self)
Declare this poisoned, and prevent further claims
Trait Implementations§
Source§impl BookkeepableQty for TotalQty
impl BookkeepableQty for TotalQty
Source§impl BookkeptQty for TotalQty
impl BookkeptQty for TotalQty
Source§impl DefaultExtTake for TotalQty
impl DefaultExtTake for TotalQty
Source§impl<Rhs: BookkeepableQty> PartialEq<Rhs> for TotalQty
impl<Rhs: BookkeepableQty> PartialEq<Rhs> for TotalQty
Auto Trait Implementations§
impl Freeze for TotalQty
impl RefUnwindSafe for TotalQty
impl Send for TotalQty
impl Sync for TotalQty
impl Unpin for TotalQty
impl UnwindSafe for TotalQty
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
Converts
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> ⓘ
Converts
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