Skip to main content

made_core/value_objects/ceremony/
ceremony_step.rs

1use serde::{Deserialize, Serialize};
2
3use super::{RetryPolicy, StateId, StepHandlerConfig, StepHandlerKind, StepId, StepTimeout};
4
5#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
6pub struct CeremonyStep {
7    id: StepId,
8    state_id: StateId,
9    handler_kind: StepHandlerKind,
10    handler_config: StepHandlerConfig,
11    retry_policy: RetryPolicy,
12    timeout: Option<StepTimeout>,
13}
14
15impl CeremonyStep {
16    #[must_use]
17    pub fn new(
18        id: StepId,
19        state_id: StateId,
20        handler_kind: StepHandlerKind,
21        handler_config: StepHandlerConfig,
22        retry_policy: RetryPolicy,
23        timeout: Option<StepTimeout>,
24    ) -> Self {
25        Self {
26            id,
27            state_id,
28            handler_kind,
29            handler_config,
30            retry_policy,
31            timeout,
32        }
33    }
34
35    #[must_use]
36    pub fn id(&self) -> &StepId {
37        &self.id
38    }
39
40    #[must_use]
41    pub fn state_id(&self) -> &StateId {
42        &self.state_id
43    }
44
45    #[must_use]
46    pub fn handler_kind(&self) -> &StepHandlerKind {
47        &self.handler_kind
48    }
49
50    #[must_use]
51    pub fn handler_config(&self) -> &StepHandlerConfig {
52        &self.handler_config
53    }
54
55    #[must_use]
56    pub fn retry_policy(&self) -> RetryPolicy {
57        self.retry_policy
58    }
59
60    #[must_use]
61    pub fn timeout(&self) -> Option<StepTimeout> {
62        self.timeout
63    }
64}