pub struct ReservationLedger { /* private fields */ }Implementations§
Source§impl ReservationLedger
impl ReservationLedger
Sourcepub fn available_handles(&self) -> usize
pub fn available_handles(&self) -> usize
Vacancies in THIS actual ledger, including every retained external owner.
Source§impl ReservationLedger
impl ReservationLedger
Sourcepub const fn new(
host_cap: ResourceBudget,
cell_cap: ResourceBudget,
role_cap: ResourceBudget,
session_cap: ResourceBudget,
operation_cap: ResourceBudget,
) -> ReservationLedger
pub const fn new( host_cap: ResourceBudget, cell_cap: ResourceBudget, role_cap: ResourceBudget, session_cap: ResourceBudget, operation_cap: ResourceBudget, ) -> ReservationLedger
Creates a default ReservationLedger.
Sourcepub fn reserve(
&mut self,
add: ResourceBudget,
verified_peer: bool,
) -> Result<ReservationHandle, QdnfError>
pub fn reserve( &mut self, add: ResourceBudget, verified_peer: bool, ) -> Result<ReservationHandle, QdnfError>
Reserve every listed scope or leave every counter unchanged.
Sourcepub fn release(&mut self, handle: ReservationHandle) -> Result<(), QdnfError>
pub fn release(&mut self, handle: ReservationHandle) -> Result<(), QdnfError>
Releases handle’s reservation.
Sourcepub fn release_checked_bytes(
&mut self,
handle: ReservationHandle,
expected_bytes: u64,
) -> Result<(), QdnfError>
pub fn release_checked_bytes( &mut self, handle: ReservationHandle, expected_bytes: u64, ) -> Result<(), QdnfError>
Release handle only if (slot, generation) matches AND the authoritative
recorded byte reservation equals expected_bytes (R10 / R11).
Sourcepub fn used(&self) -> AdmissionScopes
pub fn used(&self) -> AdmissionScopes
Aggregate usage across admission scopes.
Sourcepub fn transient_used(&self) -> ResourceBudget
pub fn transient_used(&self) -> ResourceBudget
Transient-scope usage.
Sourcepub fn host_remaining_bytes(&self) -> u64
pub fn host_remaining_bytes(&self) -> u64
Host bytes remaining under budget.
Auto Trait Implementations§
impl Freeze for ReservationLedger
impl RefUnwindSafe for ReservationLedger
impl Send for ReservationLedger
impl Sync for ReservationLedger
impl Unpin for ReservationLedger
impl UnsafeUnpin for ReservationLedger
impl UnwindSafe for ReservationLedger
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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