hyperactor/testing/
ids.rs1use crate::ActorAddr;
15use crate::PortAddr;
16use crate::ProcAddr;
17use crate::channel::ChannelAddr;
18use crate::channel::ChannelTransport;
19
20pub fn test_proc_id(name: &str) -> ProcAddr {
22 ProcAddr::singleton(
23 ChannelAddr::any(ChannelTransport::Local),
24 format!("test_{name}"),
25 )
26}
27
28pub fn test_proc_id_with_addr(addr: ChannelAddr, name: &str) -> ProcAddr {
30 ProcAddr::singleton(addr, format!("test_{name}"))
31}
32
33pub fn test_actor_id(proc_name: &str, actor_name: &str) -> ActorAddr {
35 test_proc_id(proc_name).actor_addr(actor_name)
36}
37
38pub fn test_port_id(proc_name: &str, actor_name: &str, port: u64) -> PortAddr {
40 test_actor_id(proc_name, actor_name).port_addr(port.into())
41}