use super::spec::ParticipantSpec;
use crate::participant::context::{ResetContext, SetupContext, StepContext};
use crate::participant::scheduler::StepSchedule;
#[expect(
async_fn_in_trait,
reason = "setup and shutdown are awaited directly by the runner; scheduled state transitions remain synchronous"
)]
pub trait Participant: ParticipantSpec {
async fn setup(
&self,
ctx: &mut SetupContext<Self>,
config: Self::Config,
) -> crate::Result<(Self::State, Self::Api)>;
fn step(
&self,
_api: &Self::Api,
_step: StepContext,
_state: &mut Self::State,
) -> crate::Result<()> {
Ok(())
}
fn reset(
&self,
_ctx: ResetContext,
_api: &Self::Api,
_state: &mut Self::State,
) -> crate::Result<()> {
Ok(())
}
async fn shutdown(&self, _api: &Self::Api, _state: &mut Self::State) -> crate::Result<()> {
Ok(())
}
#[doc(hidden)]
fn __step_schedule() -> Option<StepSchedule> {
None
}
}