summaryrefslogtreecommitdiffstats
path: root/src/client.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-09-03 19:41:42 -0400
committerJesse Luehrs <doy@tozt.net>2014-09-03 19:41:42 -0400
commitc5116ef186749a2ae57e3620ad766a46c178cbbb (patch)
tree26edfcb223a177c2685a86948767089809a26c84 /src/client.rs
parentaac2fa3928fcd1140115279a34295fc7a2f9f73a (diff)
downloadrust-irc-c5116ef186749a2ae57e3620ad766a46c178cbbb.tar.gz
rust-irc-c5116ef186749a2ae57e3620ad766a46c178cbbb.zip
add support for writing irc messages
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client.rs b/src/client.rs
index 9dd5191..86c3857 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -39,4 +39,13 @@ impl Client {
None => fail!(),
}
}
+
+ pub fn write (&mut self, msg: Message) {
+ match self.connection {
+ Some(ref mut conn) => {
+ msg.write_protocol_string(conn);
+ },
+ None => fail!(),
+ }
+ }
}