hyperactor_mesh/
reference.rs1use std::cmp::Ord;
10use std::cmp::PartialOrd;
11use std::fmt;
12use std::hash::Hash;
13use std::str::FromStr;
14
15use hyperactor_config::AttrValue;
16use serde::Deserialize;
17use serde::Serialize;
18use typeuri::Named;
19
20use crate::Name;
21
22#[derive(
23 Debug,
24 Serialize,
25 Deserialize,
26 Clone,
27 PartialEq,
28 Eq,
29 PartialOrd,
30 Hash,
31 Ord,
32 Named
33)]
34pub struct ProcMeshId(pub String);
35
36#[derive(
38 Debug,
39 Serialize,
40 Deserialize,
41 Clone,
42 PartialEq,
43 Eq,
44 PartialOrd,
45 Hash,
46 Ord,
47 Named,
48 AttrValue
49)]
50pub struct ActorMeshId(pub Name);
51
52impl fmt::Display for ActorMeshId {
53 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
54 write!(f, "{}", self.0)
55 }
56}
57
58impl FromStr for ActorMeshId {
59 type Err = anyhow::Error;
60
61 fn from_str(s: &str) -> Result<Self, Self::Err> {
62 Ok(ActorMeshId(Name::from_str(s)?))
63 }
64}