pub struct CapacityManagers { /* private fields */ }Expand description
Capacity counters installed at startup; admission acquires permits later.
Implementations§
Source§impl CapacityManagers
impl CapacityManagers
Sourcepub fn new(
max_global: usize,
channels: impl IntoIterator<Item = (ChannelId, usize)>,
) -> Self
pub fn new( max_global: usize, channels: impl IntoIterator<Item = (ChannelId, usize)>, ) -> Self
Build managers from runtime and Channel limits.
Sourcepub fn global_active(&self) -> usize
pub fn global_active(&self) -> usize
Global active count (observability / tests).
Sourcepub fn channel_active(&self, id: &ChannelId) -> Option<usize>
pub fn channel_active(&self, id: &ChannelId) -> Option<usize>
Per-Channel active count.
Sourcepub fn max_global(&self) -> usize
pub fn max_global(&self) -> usize
Configured global max.
Sourcepub fn try_reserve(self: &Arc<Self>, channel: &ChannelId) -> bool
pub fn try_reserve(self: &Arc<Self>, channel: &ChannelId) -> bool
Try reserve one global + channel slot (WP-04 will use; available for tests).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CapacityManagers
impl RefUnwindSafe for CapacityManagers
impl Send for CapacityManagers
impl Sync for CapacityManagers
impl Unpin for CapacityManagers
impl UnsafeUnpin for CapacityManagers
impl UnwindSafe for CapacityManagers
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