Struct pircolate::command::PrivMsg [] [src]

pub struct PrivMsg<'a>(pub &'a str, pub &'a str);

Represents a PRIVMSG command. The first element is the target of the message and the second eleement is the message.

Examples

if let Some(PrivMsg(user, message)) = msg.command::<PrivMsg>() {
    println!("<{}> {}.", user, message);
}

Trait Implementations

impl<'a> Command<'a> for PrivMsg<'a>
[src]

Provides the name of the command to be matched. Examples include PRIVMSG or PING.

This method takes in an iterator of arguments associated with a Message and attempts to parse the arguments into a matched Command. If no match is found, None is returned. Read more

A default implementation that takes in the given command name and arguments and attempts to match the command and parse the arguments into a strongly typed representation. If there is no match or the parse fails, it returns None. Read more