Skip to main content

ResumeHooks

Trait ResumeHooks 

Source
pub trait ResumeHooks {
    // Required methods
    fn start_watcher(&self, session_name: &str, record: &ExecutionRecord);
    fn relaunch(
        &self,
        backend: &str,
        command: &str,
        options: &IsolationOptions,
    ) -> IsolationResult;
    fn reconcile(&self, record: &ExecutionRecord) -> ExecutionRecord;

    // Provided method
    fn attach_watcher(
        &self,
        session_name: &str,
        record: &ExecutionRecord,
    ) -> Result<(), String> { ... }
}
Expand description

Side effects a resume performs beyond running plan steps.

Injectable so tests can exercise the full resume flow without spawning a completion watcher, launching an isolation backend, or reading log files.

Required Methods§

Source

fn start_watcher(&self, session_name: &str, record: &ExecutionRecord)

Attach a fresh completion watcher to a resumed docker session.

Source

fn relaunch( &self, backend: &str, command: &str, options: &IsolationOptions, ) -> IsolationResult

Launch the command again through its isolation backend.

Source

fn reconcile(&self, record: &ExecutionRecord) -> ExecutionRecord

Resolve the terminal result of a session that ended unsupervised.

Provided Methods§

Source

fn attach_watcher( &self, session_name: &str, record: &ExecutionRecord, ) -> Result<(), String>

Report attachment failures while keeping existing injectable hooks compatible.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§