@@ -18,7 +18,7 @@ pub struct Port {
1818
1919
2020#[ derive( Debug , Default , RustcDecodable , RustcEncodable , Clone ) ]
21- pub struct ParticipantInfo {
21+ pub struct Info {
2222 pub id : String , // unique name
2323 pub role : String , // role participant has
2424 pub component : String , // component the participant is instance of
@@ -29,13 +29,13 @@ pub struct ParticipantInfo {
2929}
3030
3131pub struct InfoBuilder {
32- info : ParticipantInfo
32+ info : Info
3333}
3434
3535impl InfoBuilder {
3636 pub fn new ( component : & str ) -> InfoBuilder {
3737 InfoBuilder {
38- info : ParticipantInfo { component : component. to_string ( ) , .. Default :: default ( ) }
38+ info : Info { component : component. to_string ( ) , .. Default :: default ( ) }
3939 }
4040 }
4141
@@ -59,7 +59,7 @@ impl InfoBuilder {
5959 self . info . outports . push ( port) ;
6060 self
6161 }
62- pub fn build ( & self ) -> ParticipantInfo {
62+ pub fn build ( & self ) -> Info {
6363 return self . info . clone ( ) ;
6464 }
6565}
@@ -68,7 +68,7 @@ impl InfoBuilder {
6868type SendFunction = fn ( String , Vec < u8 > ) ;
6969pub type ProcessFunction = fn ( Vec < u8 > ) -> Result < Vec < u8 > , Vec < u8 > > ;
7070pub struct Participant {
71- pub info : ParticipantInfo ,
71+ pub info : Info ,
7272 pub process : ProcessFunction ,
7373}
7474
@@ -89,7 +89,7 @@ fn create_queue_and_send(channel: &mut Channel, queue_name: &str, payload: Strin
8989 res. expect ( "send on new queue failed" ) ;
9090}
9191
92- fn send_discovery ( channel : & mut Channel , info : & ParticipantInfo ) {
92+ fn send_discovery ( channel : & mut Channel , info : & Info ) {
9393 let queue_name = "fbp" ; // TODO: use an exchange istead, requires protocol change in msgflo
9494
9595 let payload = json:: encode ( & info) . unwrap ( ) ;
@@ -211,7 +211,7 @@ impl Default for Options {
211211 }
212212}
213213
214- fn normalize_info ( old : & ParticipantInfo , options : & Options ) -> ParticipantInfo {
214+ fn normalize_info ( old : & Info , options : & Options ) -> Info {
215215 use rand:: { thread_rng, Rng } ;
216216
217217 let mut new = old. clone ( ) ;
0 commit comments