pub fn broadcast_message_for_port(&self, port_name: &String, msg: SerialResponse) -> Vec<Error> {
    debug!(
      "Broadcasting '{}' to all subscribers registered on port {}",
      &msg, port_name
    );
    let mut res = Vec::new();
    for (sub_id, sub) in self.subscriptions.iter() {
      if sub.ports.iter().position(|p| *p == *port_name).is_some() {
        match self.send_message(sub_id, msg.clone()) {
          Err(e) => res.push(e),
          _ => debug!("  Broadcast to '{}' was successful", sub_id),
        }
      }
    }
    res
  }
/// Broadcast message to all subscribers registered for a given port
Broadcast message to all subscribers registered for a given port
Broadcast message to all subscribers registered for a given port
pub fn broadcast_message_for_port(&self, port_name: &String, msg: SerialResponse) -> Vec<Error> {
    debug!(
      "Broadcasting '{}' to all subscribers registered on port {}",
      &msg, port_name
    );
    let mut res = Vec::new();
    for (sub_id, sub) in self.subscriptions.iter() {
      if sub.ports.iter().position(|p| *p == *port_name).is_some() {
        match self.send_message(sub_id, msg.clone()) {
          Err(e) => res.push(e),
          _ => debug!("  Broadcast to '{}' was successful", sub_id),
        }
      }
    }
    res
  }
pub fn broadcast_message_for_port ( & self , port_name : & String , msg : SerialResponse ) -> Vec < Error > { debug ! ( " " msg port_name ) ; let mut res = Vec :: new ( ) ; for ( sub_id , sub ) in self . subscriptions . iter ( ) { if sub . ports . iter ( ) . position ( | p | * p == * port_name ) . is_some ( ) { match self . send_message ( sub_id , msg . clone ( ) ) { Err ( e ) => res . push ( e ) , _ => debug ! ( " " sub_id ) , } } } res }
Broadcast message to all subscribers registered for a given port
Broadcast message to all subscribers registered for a given port
&self
port_name
&String
msg
SerialResponse
&self
port_name
&String
msg
SerialResponse