temporalio-common 0.3.0

Common functionality for the Temporal SDK Core, Client, and Rust SDK
Documentation
//! Contains types for activity definitions, used by the code generated by the macros for defining
//! activities, or directly by users targeting activities in other languages.

use crate::data_converters::{TemporalDeserializable, TemporalSerializable};

/// Implement on a marker struct to define an activity.
///
/// Typically, you will want to use the `#[activity]` attribute within an `#[activities]` macro to
/// define activities. However, this trait may be implemented manually if desired.
pub trait ActivityDefinition {
    /// Type of the input argument to the workflow
    type Input: TemporalDeserializable + TemporalSerializable + 'static;
    /// Type of the output of the workflow
    type Output: TemporalDeserializable + TemporalSerializable + 'static;

    /// The name that will be used for the activity type.
    fn name() -> &'static str
    where
        Self: Sized;
}