pub struct TransactionToolCapacity { /* private fields */ }Expand description
Per-transaction tool capacity tracker (item queue + concurrency + per-tool).
Implementations§
Source§impl TransactionToolCapacity
impl TransactionToolCapacity
Sourcepub fn new(
shared: Arc<SharedToolCapacity>,
max_concurrent: usize,
max_queued: usize,
) -> Arc<Self> ⓘ
pub fn new( shared: Arc<SharedToolCapacity>, max_concurrent: usize, max_queued: usize, ) -> Arc<Self> ⓘ
Build for one transaction.
Sourcepub fn configure_tool(self: &Arc<Self>, tool_id: ToolId, max_concurrent: usize)
pub fn configure_tool(self: &Arc<Self>, tool_id: ToolId, max_concurrent: usize)
Register per-tool max concurrency from a resolved set.
Sourcepub fn try_enqueue(self: &Arc<Self>) -> bool
pub fn try_enqueue(self: &Arc<Self>) -> bool
Reserve a queue slot before validation work (released on failure or after acquire).
Sourcepub fn try_acquire(self: &Arc<Self>, tool_id: &ToolId) -> Option<ToolPermit>
pub fn try_acquire(self: &Arc<Self>, tool_id: &ToolId) -> Option<ToolPermit>
Move from queued to running if capacity allows.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TransactionToolCapacity
impl RefUnwindSafe for TransactionToolCapacity
impl Send for TransactionToolCapacity
impl Sync for TransactionToolCapacity
impl Unpin for TransactionToolCapacity
impl UnsafeUnpin for TransactionToolCapacity
impl UnwindSafe for TransactionToolCapacity
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