hehe_core/traits/mod.rs
1use crate::error::Result;
2use crate::types::Id;
3
4pub trait Identifiable {
5 fn id(&self) -> Id;
6}
7
8pub trait Validatable {
9 fn validate(&self) -> Result<()>;
10}
11
12#[async_trait::async_trait]
13pub trait Lifecycle: Send + Sync {
14 async fn start(&mut self) -> Result<()>;
15 async fn stop(&mut self) -> Result<()>;
16 fn is_running(&self) -> bool;
17}
18
19pub trait Named {
20 fn name(&self) -> &str;
21}