pub struct TurnControl<D> { /* private fields */ }Expand description
A unique driver lease for an approved target in one turn. The caller supplies that turn’s cancellation token after approval and keeps the lease off durable history.
Implementations§
Source§impl<D: Driver> TurnControl<D>
impl<D: Driver> TurnControl<D>
Sourcepub fn after_approval(driver: D, turn: &CancellationToken) -> Self
pub fn after_approval(driver: D, turn: &CancellationToken) -> Self
Create the controller after the run loop grants per-turn target approval.
Sourcepub fn ensure_turn_active(&self) -> Result<()>
pub fn ensure_turn_active(&self) -> Result<()>
Check the parent turn before returning private results to the provider.
§Errors
Returns an error when the parent turn has ended.
Sourcepub fn revoke_target(&self)
pub fn revoke_target(&self)
End this target lease without cancelling unrelated work in the turn.
Sourcepub async fn execute_batch(
&mut self,
call_id: &str,
actions: &[Action],
timeout: Duration,
) -> Result<Vec<Observation>>
pub async fn execute_batch( &mut self, call_id: &str, actions: &[Action], timeout: Duration, ) -> Result<Vec<Observation>>
Execute an ordered batch once and return observations in the same order.
§Errors
Returns an error for invalid or repeated calls, an expired deadline, revocation, driver failure, or an exceeded screenshot budget.
Trait Implementations§
Source§impl<D> Drop for TurnControl<D>
impl<D> Drop for TurnControl<D>
Auto Trait Implementations§
impl<D> Forget for TurnControl<D>
impl<D> Freeze for TurnControl<D>where
D: Freeze,
impl<D> Move for TurnControl<D>
impl<D> RefUnwindSafe for TurnControl<D>where
D: RefUnwindSafe,
impl<D> Send for TurnControl<D>where
D: Send,
impl<D> Sync for TurnControl<D>where
D: Sync,
impl<D> Unpin for TurnControl<D>where
D: Unpin,
impl<D> UnsafeUnpin for TurnControl<D>where
D: UnsafeUnpin,
impl<D> UnwindSafe for TurnControl<D>where
D: UnwindSafe,
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