use std::{fmt, marker::PhantomData};
use serde::{Serialize, de::DeserializeOwned};
pub struct Step<Output> {
name: &'static str,
marker: PhantomData<fn() -> Output>,
}
impl<Output> Copy for Step<Output> {}
impl<Output> Clone for Step<Output> {
fn clone(&self) -> Self {
*self
}
}
impl<Output> Step<Output> {
pub const fn name(self) -> &'static str {
self.name
}
}
impl<Output> Step<Output>
where
Output: Serialize + DeserializeOwned + Send + 'static,
{
pub const fn new(name: &'static str) -> Self {
Self { name, marker: PhantomData }
}
}
impl<Output> fmt::Debug for Step<Output> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_tuple("Step").field(&self.name).finish()
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct Sleep {
name: &'static str,
}
impl Sleep {
pub const fn new(name: &'static str) -> Self {
Self { name }
}
pub const fn name(self) -> &'static str {
self.name
}
}