Skip to main content

TurnControl

Struct TurnControl 

Source
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>

Source

pub fn after_approval(driver: D, turn: &CancellationToken) -> Self

Create the controller after the run loop grants per-turn target approval.

Source

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.

Source

pub fn revoke_target(&self)

End this target lease without cancelling unrelated work in the turn.

Source

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>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more