Added for_each_incoming helper to Server.
This commit is contained in:
parent
f0e49d403f
commit
8c9a1aca2c
4 changed files with 23 additions and 12 deletions
|
@ -12,9 +12,11 @@ fn main() {
|
|||
use_ssl: Some(true),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let server = IrcServer::from_config(config).unwrap();
|
||||
server.identify().unwrap();
|
||||
server.stream().for_each(|message| {
|
||||
|
||||
server.for_each_incoming(|message| {
|
||||
print!("{}", message);
|
||||
match message.command {
|
||||
Command::PRIVMSG(ref target, ref msg) => {
|
||||
|
@ -24,6 +26,5 @@ fn main() {
|
|||
}
|
||||
_ => (),
|
||||
}
|
||||
Ok(())
|
||||
}).wait().unwrap()
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue