use std::any::TypeId; use zestors_core::{ actor_type::{Accepts, IntoAddress}, messaging::{BoxedMessage, Protocol, ProtocolMessage, SendPart}, process::Address, DynAccepts, DynAddress, }; pub(crate) struct TestProt; impl Protocol for TestProt { fn try_unbox(_boxed: BoxedMessage) -> Result { todo!() } fn boxed(self) -> BoxedMessage { todo!() } fn accepts(_id: &TypeId) -> bool { todo!() } } impl ProtocolMessage for TestProt { fn from_sends(_msg: SendPart) -> Self where Self: Sized, { todo!() } fn try_into_sends(self) -> Result, Self> where Self: Sized, { todo!() } } impl ProtocolMessage for TestProt { fn from_sends(_msg: SendPart) -> Self where Self: Sized, { todo!() } fn try_into_sends(self) -> Result, Self> where Self: Sized, { todo!() } } fn test1(address: Address, address2: DynAddress![u32, u64]) { address.try_send(10 as u32).unwrap(); // address.try_send_remote(&(10 as u32)); // address.try_send_remote(&(10 as u64)); // address.try_send(10 as u128).unwrap(); address2.try_send(10 as u32).unwrap(); // address2.try_send(10 as u128).unwrap(); } fn test2(addr: DynAddress![u32, u64]) { addr.clone().transform::(); addr.clone().transform::(); addr.clone().transform::(); addr.clone().transform::(); // addr.clone().transform::>>(); } fn test3(a1: DynAddress![u32, u64], a2: Address, a3: DynAddress![u32]) { test4(&a1); test4(&a2); test5(a1); test5(a2); // test4(a3); } fn test4(a: &Address + Accepts>) { a.try_send(10 as u32).unwrap(); a.try_send(10 as u64).unwrap(); // a.try_send(10 as u128).unwrap(); } fn test5(a: impl IntoAddress) { let a = a.into_address(); a.try_send(10 as u32).unwrap(); }