|
@@ -0,0 +1,58 @@
|
|
|
+use btproto::protocol;
|
|
|
+
|
|
|
+mod ping_proto {
|
|
|
+ use super::*;
|
|
|
+
|
|
|
+ protocol! {
|
|
|
+ ClientInit?Activate -> SentPing, Listening!Ping
|
|
|
+ ServerInit?Activate -> Listening
|
|
|
+ Listening?Ping -> End, SentPing!Ping::Reply
|
|
|
+ SentPing?Ping::Reply -> End
|
|
|
+ }
|
|
|
+
|
|
|
+ // This protocol definition is observed by the procedural macro as the following sequence of
|
|
|
+ // tokens:
|
|
|
+ // Ident { ident: "ClientInit", span: #0 bytes(109..119) }
|
|
|
+ // Punct { ch: '?', spacing: Alone, span: #0 bytes(119..120) }
|
|
|
+ // Ident { ident: "Activate", span: #0 bytes(120..128) }
|
|
|
+ // Punct { ch: '-', spacing: Joint, span: #0 bytes(129..130) }
|
|
|
+ // Punct { ch: '>', spacing: Alone, span: #0 bytes(130..131) }
|
|
|
+ // Ident { ident: "SentPing", span: #0 bytes(132..140) }
|
|
|
+ // Punct { ch: ',', spacing: Alone, span: #0 bytes(140..141) }
|
|
|
+ // Ident { ident: "Listening", span: #0 bytes(142..151) }
|
|
|
+ // Punct { ch: '!', spacing: Alone, span: #0 bytes(151..152) }
|
|
|
+ // Ident { ident: "Ping", span: #0 bytes(152..156) }
|
|
|
+ // Ident { ident: "ServerInit", span: #0 bytes(165..175) }
|
|
|
+ // Punct { ch: '?', spacing: Alone, span: #0 bytes(175..176) }
|
|
|
+ // Ident { ident: "Activate", span: #0 bytes(176..184) }
|
|
|
+ // Punct { ch: '-', spacing: Joint, span: #0 bytes(185..186) }
|
|
|
+ // Punct { ch: '>', spacing: Alone, span: #0 bytes(186..187) }
|
|
|
+ // Ident { ident: "Listening", span: #0 bytes(188..197) }
|
|
|
+ // Ident { ident: "Listening", span: #0 bytes(206..215) }
|
|
|
+ // Punct { ch: '?', spacing: Alone, span: #0 bytes(215..216) }
|
|
|
+ // Ident { ident: "Ping", span: #0 bytes(216..220) }
|
|
|
+ // Punct { ch: '-', spacing: Joint, span: #0 bytes(221..222) }
|
|
|
+ // Punct { ch: '>', spacing: Alone, span: #0 bytes(222..223) }
|
|
|
+ // Ident { ident: "End", span: #0 bytes(224..227) }
|
|
|
+ // Punct { ch: ',', spacing: Alone, span: #0 bytes(227..228) }
|
|
|
+ // Ident { ident: "SentPing", span: #0 bytes(229..237) }
|
|
|
+ // Punct { ch: '!', spacing: Alone, span: #0 bytes(237..238) }
|
|
|
+ // Ident { ident: "Ping", span: #0 bytes(238..242) }
|
|
|
+ // Punct { ch: ':', spacing: Joint, span: #0 bytes(242..243) }
|
|
|
+ // Punct { ch: ':', spacing: Alone, span: #0 bytes(243..244) }
|
|
|
+ // Ident { ident: "Reply", span: #0 bytes(244..249) }
|
|
|
+ // Ident { ident: "SentPing", span: #0 bytes(258..266) }
|
|
|
+ // Punct { ch: '?', spacing: Alone, span: #0 bytes(266..267) }
|
|
|
+ // Ident { ident: "Ping", span: #0 bytes(267..271) }
|
|
|
+ // Punct { ch: ':', spacing: Joint, span: #0 bytes(271..272) }
|
|
|
+ // Punct { ch: ':', spacing: Alone, span: #0 bytes(272..273) }
|
|
|
+ // Ident { ident: "Reply", span: #0 bytes(273..278) }
|
|
|
+ // Punct { ch: '-', spacing: Joint, span: #0 bytes(279..280) }
|
|
|
+ // Punct { ch: '>', spacing: Alone, span: #0 bytes(280..281) }
|
|
|
+ // Ident { ident: "End", span: #0 bytes(282..285) }
|
|
|
+
|
|
|
+ #[test]
|
|
|
+ fn traits_created() {
|
|
|
+ assert!(true);
|
|
|
+ }
|
|
|
+}
|