Skip to content

Commit b9ecec6

Browse files
committed
participant: Remove prefix from Info
1 parent 0930150 commit b9ecec6

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

examples/repeat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
extern crate msgflo;
33

4-
use msgflo::participant::{ParticipantInfo, Participant, InfoBuilder};
4+
use msgflo::participant::{Participant, InfoBuilder};
55

66
fn main() {
77
let info = InfoBuilder::new("rust/Repeat")

src/participant.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

3131
pub struct InfoBuilder {
32-
info: ParticipantInfo
32+
info: Info
3333
}
3434

3535
impl 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 {
6868
type SendFunction = fn(String, Vec<u8>);
6969
pub type ProcessFunction = fn(Vec<u8>) -> Result<Vec<u8>, Vec<u8>>;
7070
pub 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

Comments
 (0)