Trait hiirc::IrcWrite
[−]
[src]
pub trait IrcWrite { fn raw<S: AsRef<str>>(&self, raw: S) -> Result<(), Error>; fn nick(&self, nickname: &str) -> Result<(), Error> { ... } fn user(&self, username: &str, realname: &str) -> Result<(), Error> { ... } fn ping(&self, server: &str) -> Result<(), Error> { ... } fn pong(&self, server: &str) -> Result<(), Error> { ... } fn pass(&self, password: &str) -> Result<(), Error> { ... } fn privmsg(&self, target: &str, text: &str) -> Result<(), Error> { ... } fn notice(&self, target: &str, text: &str) -> Result<(), Error> { ... } fn join(&self, channel: &str, password: Option<&str>) -> Result<(), Error> { ... } fn part(&self, channel: &str, message: Option<&str>) -> Result<(), Error> { ... } fn quit(&self, message: Option<&str>) -> Result<(), Error> { ... } fn get_topic(&self, channel: &str) -> Result<(), Error> { ... } fn set_topic(&self, channel: &str, topic: &str) -> Result<(), Error> { ... } fn kick(&self, channel: &str, nickname: &str) -> Result<(), Error> { ... } }
Ability to send commands to the irc server.
This trait represents the ability to send messages to a server. It's implemented by Irc and Deferred.
Required Methods
fn raw<S: AsRef<str>>(&self, raw: S) -> Result<(), Error>
Send a raw message. A newline is added for you.
If you add a new line it will be refused as a multiline message.
Provided Methods
fn nick(&self, nickname: &str) -> Result<(), Error>
NICK command.
fn user(&self, username: &str, realname: &str) -> Result<(), Error>
USER command.
fn ping(&self, server: &str) -> Result<(), Error>
PING command.
fn pong(&self, server: &str) -> Result<(), Error>
PONG command.
fn pass(&self, password: &str) -> Result<(), Error>
PASS command.
fn privmsg(&self, target: &str, text: &str) -> Result<(), Error>
PRIVMSG command.
fn notice(&self, target: &str, text: &str) -> Result<(), Error>
NOTICE command.
fn join(&self, channel: &str, password: Option<&str>) -> Result<(), Error>
JOIN command.
fn part(&self, channel: &str, message: Option<&str>) -> Result<(), Error>
PART command.
fn quit(&self, message: Option<&str>) -> Result<(), Error>
QUIT command.
fn get_topic(&self, channel: &str) -> Result<(), Error>
Retrive the topic of a given channel.
The topic
event will receive the information.
fn set_topic(&self, channel: &str, topic: &str) -> Result<(), Error>
Set the topic of a channel.
To remove the topic of a channel, use an empty topic string.
It will also trigger a topic_change
event.
fn kick(&self, channel: &str, nickname: &str) -> Result<(), Error>
KICK command.
Implementors
impl IrcWrite for Irc