Skip to main content

JobControl

Trait JobControl 

Source
pub trait JobControl: Send + Sync {
    // Required methods
    fn pause<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        site: Uuid,
        job: &'life1 str,
        reason: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn resume<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        site: Uuid,
        job: &'life1 str,
        decision: &'life2 OwnerDecision,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn paused<'life0, 'life1, 'async_trait>(
        &'life0 self,
        site: Uuid,
        job: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

The hook a guardrail breach pauses a job through (spec 3.5 §7.11, A-I15): the harness stops the job’s next action. JobPauses is an implementation that is also a ToolPolicy.

Required Methods§

Source

fn pause<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, site: Uuid, job: &'life1 str, reason: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Pauses job of site for reason before its next action. Pausing a paused job keeps it paused.

§Errors

Returns the error that kept the pause from taking hold.

Source

fn resume<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, site: Uuid, job: &'life1 str, decision: &'life2 OwnerDecision, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Lifts the pause of job by an owner’s decision; false when it was not paused.

§Errors

Returns KernelError::Unauthorized for a decision no person made.

Source

fn paused<'life0, 'life1, 'async_trait>( &'life0 self, site: Uuid, job: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Why job is paused, or None when it is not.

§Errors

Returns the error that kept the answer from being read.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§