Skip to main content

Action

Trait Action 

Source
pub trait Action: Send + Sync {
    // Required methods
    fn id(&self) -> ActionId;
    fn deps(&self) -> Vec<ActionId>;
    fn input_hash<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: &'life1 Ctx,
    ) -> Pin<Box<dyn Future<Output = Result<Sha256, BuildError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn execute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: &'life1 Ctx,
    ) -> Pin<Box<dyn Future<Output = Result<BuildOutput, BuildError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Represents an executable action within the repolith graph.

Actions are the fundamental units of work. They declare their dependencies, compute their input state, and execute their logic.

Note: Long-running execute implementations should periodically poll ctx.cancel.is_cancelled() to support graceful termination.

Required Methods§

Source

fn id(&self) -> ActionId

Returns the unique identifier for this action.

Source

fn deps(&self) -> Vec<ActionId>

Returns the list of action IDs that this action depends on.

Source

fn input_hash<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 Ctx, ) -> Pin<Box<dyn Future<Output = Result<Sha256, BuildError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Computes the hash representing the input state of this action. This is used for caching and determining if the action needs to run.

Source

fn execute<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 Ctx, ) -> Pin<Box<dyn Future<Output = Result<BuildOutput, BuildError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Executes the action’s core logic.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§