use ::type_sets::Set; use meslin::*; /// Example protocol that can be used #[derive(Debug, From, TryInto, DynFromInto)] pub enum MyProtocol { A(u32), B(HelloWorld), C(Request), } #[derive(Debug, Message, From)] #[from(forward)] pub struct HelloWorld(pub String); #[tokio::test] async fn test() { let (sender, _receiver) = mpmc::unbounded::(); let _ = sender.clone().into_dyn::(); let boxed_sender = sender.clone().into_boxed(); boxed_sender .dyn_send::("Hello world!") .await .unwrap(); let dyn_sender = ::from_boxed_unchecked(boxed_sender); dyn_sender .dyn_send::("Hello world!") .await .unwrap(); let dyn_sender = ::new(sender.clone()); let dyn_sender = dyn_sender.transform::(); let dyn_sender = dyn_sender.try_transform::().unwrap(); dyn_sender.try_transform::().unwrap_err(); }