SHARE
TWEET

Untitled

a guest Jan 19th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for m in messages {
  2.     for conn in match m.destination() {
  3.         message::Destination::All                   => {
  4.             connections.values()
  5.         },
  6.         message::Destination::Single(cid)           => {
  7.             connections.get(cid).iter()
  8.         },
  9.         message::Destination::Include(ref list)     => {
  10.             list.iter().filter_map(|cid| connections.get(cid))
  11.         },
  12.         message::Destination::Exclude(ref list)     => {
  13.             connections.iter().filter(|(cid, conn)| !list.contains(cid))
  14.         },
  15.     } {
  16.         conn.outbound.send(m);
  17.     }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top