Skip to main content

ExecutableActivity

Trait ExecutableActivity 

Source
pub trait ExecutableActivity: ActivityDefinition + Sized {
    type Implementer: ActivityImplementer + Send + Sync + 'static;

    const REQUIRES_INSTANCE: bool;

    // Required methods
    fn definition() -> Self;
    fn execute(
        receiver: Option<Arc<Self::Implementer>>,
        ctx: ActivityContext,
        input: Self::Input,
    ) -> BoxFuture<'static, Result<Self::Output, ActivityError>>;
}
Expand description

Direct execution support generated for each activity marker by #[activities].

Applications normally use the generated implementation rather than implementing this trait manually.

Required Associated Constants§

Source

const REQUIRES_INSTANCE: bool

Whether this activity requires an implementation instance.

Required Associated Types§

Source

type Implementer: ActivityImplementer + Send + Sync + 'static

Type containing the activity implementation.

Required Methods§

Source

fn definition() -> Self

Return this activity’s definition marker.

Source

fn execute( receiver: Option<Arc<Self::Implementer>>, ctx: ActivityContext, input: Self::Input, ) -> BoxFuture<'static, Result<Self::Output, ActivityError>>

Execute the activity with already-typed input.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§