Guest User

Untitled

a guest
Jan 19th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment