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§
Sourceconst REQUIRES_INSTANCE: bool
const REQUIRES_INSTANCE: bool
Whether this activity requires an implementation instance.
Required Associated Types§
Sourcetype Implementer: ActivityImplementer + Send + Sync + 'static
type Implementer: ActivityImplementer + Send + Sync + 'static
Type containing the activity implementation.
Required Methods§
Sourcefn definition() -> Self
fn definition() -> Self
Return this activity’s definition marker.
Sourcefn execute(
receiver: Option<Arc<Self::Implementer>>,
ctx: ActivityContext,
input: Self::Input,
) -> BoxFuture<'static, Result<Self::Output, ActivityError>>
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".