pub struct RunContext {
pub cancelled: Arc<AtomicBool>,
pub cancellation: Arc<Notify>,
pub llm_calls: Arc<AtomicU64>,
pub max_llm_calls: Option<u64>,
pub llm_invocations: Arc<Mutex<Vec<Value>>>,
}Fields§
§cancelled: Arc<AtomicBool>§cancellation: Arc<Notify>§llm_calls: Arc<AtomicU64>Shared pre-invocation attempt counter. Incremented atomically for every provider attempt, including attempts that later fail or time out.
max_llm_calls: Option<u64>Run-scoped cap on provider attempts; None means unlimited.
llm_invocations: Arc<Mutex<Vec<Value>>>Shared typed ledger of observed invocations for the terminal receipt.
Implementations§
Source§impl RunContext
impl RunContext
Sourcepub fn reserve_llm_attempt(&self) -> Result<u64>
pub fn reserve_llm_attempt(&self) -> Result<u64>
Atomically reserve one provider-attempt slot BEFORE any provider call, so failed and timed-out attempts still count and concurrent nodes cannot race past the budget. A denied attempt leaves the counter unchanged.
Trait Implementations§
Source§impl Clone for RunContext
impl Clone for RunContext
Source§fn clone(&self) -> RunContext
fn clone(&self) -> RunContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RunContext
impl RefUnwindSafe for RunContext
impl Send for RunContext
impl Sync for RunContext
impl Unpin for RunContext
impl UnsafeUnpin for RunContext
impl UnwindSafe for RunContext
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