|
@@ -1,5 +1,8 @@
|
|
|
#![feature(impl_trait_in_assoc_type)]
|
|
|
|
|
|
+pub mod sector_proto;
|
|
|
+pub mod fs_proto;
|
|
|
+
|
|
|
use std::{
|
|
|
any::Any,
|
|
|
collections::HashMap,
|
|
@@ -808,10 +811,10 @@ mod tests {
|
|
|
// simple ping-pong protocol:
|
|
|
//
|
|
|
protocol! {
|
|
|
- ClientInit?Activate -> SentPing, Listening!Ping
|
|
|
- ServerInit?Activate -> Listening
|
|
|
- Listening?Ping -> End, SentPing!Ping::Reply
|
|
|
- SentPing?Ping::Reply -> End
|
|
|
+ ClientInit?Activate -> SentPing, Listening!Ping;
|
|
|
+ ServerInit?Activate -> Listening;
|
|
|
+ Listening?Ping -> End, SentPing!Ping::Reply;
|
|
|
+ SentPing?Ping::Reply -> End;
|
|
|
}
|
|
|
//
|
|
|
// In words, the protocol is described as follows.
|
|
@@ -1015,15 +1018,14 @@ mod tests {
|
|
|
// example in the survey paper "Behavioral Types in Programming Languages."
|
|
|
//
|
|
|
protocol! {
|
|
|
- CustomerInit?Activate -> Choosing
|
|
|
- AgencyInit?Activate -> Listening
|
|
|
- Choosing?Choice -> Choosing, Listening!Query|Accept|Reject
|
|
|
- Listening?Query -> Listening, Choosing!Query::Reply
|
|
|
- Choosing?Query::Reply -> Choosing
|
|
|
- Listening?Accept -> End, Choosing!Accept::Reply
|
|
|
- Choosing?Accept::Reply -> End
|
|
|
- Listening?Reject -> End, Choosing!Reject:Reply
|
|
|
- Choosing?Reject::Reply -> End
|
|
|
+ AgencyInit?Activate -> Listening;
|
|
|
+ Choosing -> Choosing, Listening!Query|Accept|Reject;
|
|
|
+ Listening?Query -> Listening, Choosing!Query::Reply;
|
|
|
+ Choosing?Query::Reply -> Choosing;
|
|
|
+ Listening?Accept -> End, Choosing!Accept::Reply;
|
|
|
+ Choosing?Accept::Reply -> End;
|
|
|
+ Listening?Reject -> End, Choosing!Reject:Reply;
|
|
|
+ Choosing?Reject::Reply -> End;
|
|
|
}
|
|
|
//
|
|
|
// The Choice message is from the runtime itself. It represents receiving input from a user.
|