Skip to main content

palladium_actor/
engine_id.rs

1use std::fmt;
2
3#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
4pub struct EngineId(pub String);
5
6impl EngineId {
7    pub fn new(s: impl Into<String>) -> Self {
8        Self(s.into())
9    }
10
11    pub fn as_str(&self) -> &str {
12        &self.0
13    }
14}
15
16impl fmt::Display for EngineId {
17    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
18        write!(f, "{}", self.0)
19    }
20}