pub struct ReservationPool { /* private fields */ }Expand description
Runtime-wide reservation pool installed at start.
Implementations§
Source§impl ReservationPool
impl ReservationPool
Sourcepub fn try_new(
max_global: usize,
channels: impl IntoIterator<Item = (ChannelId, usize)>,
) -> Result<Arc<Self>, ReservationPoolError>
pub fn try_new( max_global: usize, channels: impl IntoIterator<Item = (ChannelId, usize)>, ) -> Result<Arc<Self>, ReservationPoolError>
Build from global and per-channel maxima. Ledger capacity equals global.
Returns an error when any capacity is zero (fail closed; no silent bump).
Sourcepub fn global_active(&self) -> usize
pub fn global_active(&self) -> usize
Observability: global active reservations.
Sourcepub fn ledger_active(&self) -> usize
pub fn ledger_active(&self) -> usize
Observability: ledger entries reserved.
Sourcepub fn channel_active(&self, id: &ChannelId) -> usize
pub fn channel_active(&self, id: &ChannelId) -> usize
Observability: active reservations for one Channel.
Sourcepub fn max_global(&self) -> usize
pub fn max_global(&self) -> usize
Configured global maximum.
Sourcepub fn try_reserve(
self: &Arc<Self>,
channel: &ChannelId,
) -> Option<TransactionReservations>
pub fn try_reserve( self: &Arc<Self>, channel: &ChannelId, ) -> Option<TransactionReservations>
Try to acquire the full reservation bundle without waiting.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ReservationPool
impl RefUnwindSafe for ReservationPool
impl Send for ReservationPool
impl Sync for ReservationPool
impl Unpin for ReservationPool
impl UnsafeUnpin for ReservationPool
impl UnwindSafe for ReservationPool
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