pub struct InvocationSlot { /* private fields */ }Expand description
RAII guard around an active-invocation slot. Increments the
per-function counter on creation; decrements when dropped. Used
by invoke() so the slot is always released, even when the
underlying executor panics.
Implementations§
Source§impl InvocationSlot
impl InvocationSlot
pub fn acquire(state: &LambdaState, function_name: &str) -> Arc<AtomicU32>
Sourcepub fn from_acquired(counter: Arc<AtomicU32>) -> Self
pub fn from_acquired(counter: Arc<AtomicU32>) -> Self
Construct from an already-incremented counter handle. The
caller is responsible for ensuring the counter was bumped via
acquire; the guard handles the decrement.
Sourcepub fn current(state: &LambdaState, function_name: &str) -> u32
pub fn current(state: &LambdaState, function_name: &str) -> u32
Peek the current in-flight count for function_name without
incrementing. Returns 0 when no entry exists.
Trait Implementations§
Source§impl Drop for InvocationSlot
impl Drop for InvocationSlot
Auto Trait Implementations§
impl Freeze for InvocationSlot
impl RefUnwindSafe for InvocationSlot
impl Send for InvocationSlot
impl Sync for InvocationSlot
impl Unpin for InvocationSlot
impl UnsafeUnpin for InvocationSlot
impl UnwindSafe for InvocationSlot
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