Skip to content

Commit 0930150

Browse files
committed
participant: Remove prefix on Port
1 parent 9904f81 commit 0930150

2 files changed

Lines changed: 9 additions & 9 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, ParticipantPort, InfoBuilder};
4+
use msgflo::participant::{ParticipantInfo, Participant, InfoBuilder};
55

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

src/participant.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::slice;
88

99

1010
#[derive(Debug, Default, RustcDecodable, RustcEncodable, Clone)]
11-
pub struct ParticipantPort {
11+
pub struct Port {
1212
pub id: String, // port name
1313
pub queue: String, // the associated message queue
1414
// FIXME: support. Is a keyword so needs some special handling type: String, // datatype, ex: "boolean"
@@ -24,8 +24,8 @@ pub struct ParticipantInfo {
2424
pub component: String, // component the participant is instance of
2525
pub label: Option<String>, // (optional) short human-readable description
2626
pub icon: Option<String>, // (optional)
27-
pub inports: Vec<ParticipantPort>,
28-
pub outports: Vec<ParticipantPort>,
27+
pub inports: Vec<Port>,
28+
pub outports: Vec<Port>,
2929
}
3030

3131
pub struct InfoBuilder {
@@ -50,12 +50,12 @@ impl InfoBuilder {
5050
}
5151

5252
pub fn inport(&mut self, id: &str) -> &mut InfoBuilder {
53-
let port = ParticipantPort { id: id.to_string(), queue: "".to_string() };
53+
let port = Port { id: id.to_string(), queue: "".to_string() };
5454
self.info.inports.push(port);
5555
self
5656
}
5757
pub fn outport(&mut self, id: &str) -> &mut InfoBuilder {
58-
let port = ParticipantPort { id: id.to_string(), queue: "".to_string() };
58+
let port = Port { id: id.to_string(), queue: "".to_string() };
5959
self.info.outports.push(port);
6060
self
6161
}
@@ -138,7 +138,7 @@ impl Consumer for PortConsumer {
138138
}
139139

140140
// FIXME: actually call ProcessFunction
141-
fn setup_inport(participant: &Participant, port: &ParticipantPort, connection: &mut Connection) {
141+
fn setup_inport(participant: &Participant, port: &Port, connection: &mut Connection) {
142142
debug!("setup inport: {}", port.queue.to_string());
143143

144144
let consumer = PortConsumer {
@@ -161,7 +161,7 @@ fn setup_inport(participant: &Participant, port: &ParticipantPort, connection: &
161161
debug!("inport setup done: {:?}, {:?}", port.id.to_string(), port.queue.to_string());
162162
}
163163

164-
fn setup_outport(participant: &Participant, port: &ParticipantPort, connection: &mut Connection) {
164+
fn setup_outport(participant: &Participant, port: &Port, connection: &mut Connection) {
165165

166166
let exchange_type = "fanout".to_string();
167167
let declare = connection.channel.exchange_declare(port.queue.to_string(), exchange_type,
@@ -231,7 +231,7 @@ fn normalize_info(old: &ParticipantInfo, options: &Options) -> ParticipantInfo {
231231

232232
// generate port defaults
233233
let role = new.role.to_string(); // NOTE: would be nice to be able to pass reference to info?
234-
let normalize_port = | o: &ParticipantPort | -> ParticipantPort {
234+
let normalize_port = | o: &Port | -> Port {
235235
let mut p = o.clone();
236236
if p.queue == "" {
237237
p.queue = default_queue(role.to_string(), p.id.to_string());

0 commit comments

Comments
 (0)