pub struct CancellationBridge { /* private fields */ }Expand description
Propagates controls in the safe order: revoke desktop authority, then stop reasoning.
Implementations§
Source§impl CancellationBridge
impl CancellationBridge
Sourcepub fn new(
runtime: Arc<dyn ComputerUseRuntime>,
interrupter: Arc<dyn AgentInterrupter>,
) -> Self
pub fn new( runtime: Arc<dyn ComputerUseRuntime>, interrupter: Arc<dyn AgentInterrupter>, ) -> Self
Pair a desktop runtime with an agent interrupter.
Sourcepub async fn pause(
&self,
runtime_session_id: &str,
adk_session_id: &str,
reason: &str,
) -> Result<bool, CancellationError>
pub async fn pause( &self, runtime_session_id: &str, adk_session_id: &str, reason: &str, ) -> Result<bool, CancellationError>
Pause desktop authority for the runtime session, then interrupt the ADK agent.
§Errors
Returns CancellationError::Runtime if the pause call fails; the
ADK agent is not interrupted in that case.
Sourcepub async fn stop(
&self,
runtime_session_id: &str,
adk_session_id: &str,
reason: &str,
) -> Result<bool, CancellationError>
pub async fn stop( &self, runtime_session_id: &str, adk_session_id: &str, reason: &str, ) -> Result<bool, CancellationError>
Stop desktop authority for the runtime session, then interrupt the ADK agent.
§Errors
Returns CancellationError::Runtime if the stop call fails.
Sourcepub async fn emergency_stop(
&self,
adk_session_id: &str,
reason: &str,
) -> Result<bool, CancellationError>
pub async fn emergency_stop( &self, adk_session_id: &str, reason: &str, ) -> Result<bool, CancellationError>
Revoke all desktop authority immediately, then interrupt the ADK agent.
§Errors
Returns CancellationError::Runtime if the emergency-stop call fails.
Auto Trait Implementations§
impl !RefUnwindSafe for CancellationBridge
impl !UnwindSafe for CancellationBridge
impl Forget for CancellationBridge
impl Freeze for CancellationBridgewhere
*const ArcInner<dyn ComputerUseRuntime> is !null: Freeze,
PhantomData<ArcInner<dyn ComputerUseRuntime>>: Freeze,
*const ArcInner<dyn AgentInterrupter> is !null: Freeze,
PhantomData<ArcInner<dyn AgentInterrupter>>: Freeze,
impl Move for CancellationBridge
impl Send for CancellationBridge
impl Sync for CancellationBridge
impl Unpin for CancellationBridge
impl UnsafeUnpin for CancellationBridgewhere
*const ArcInner<dyn ComputerUseRuntime> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ComputerUseRuntime>>: UnsafeUnpin,
*const ArcInner<dyn AgentInterrupter> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn AgentInterrupter>>: UnsafeUnpin,
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