Enum irc::proto::command::Command[][src]

pub enum Command {
    PASS(String),
    NICK(String),
    USER(StringStringString),
    OPER(StringString),
    UserMODE(StringVec<Mode<UserMode>>),
    SERVICE(StringStringStringStringStringString),
    QUIT(Option<String>),
    SQUIT(StringString),
    JOIN(StringOption<String>, Option<String>),
    PART(StringOption<String>),
    ChannelMODE(StringVec<Mode<ChannelMode>>),
    TOPIC(StringOption<String>),
    NAMES(Option<String>, Option<String>),
    LIST(Option<String>, Option<String>),
    INVITE(StringString),
    KICK(StringStringOption<String>),
    PRIVMSG(StringString),
    NOTICE(StringString),
    MOTD(Option<String>),
    LUSERS(Option<String>, Option<String>),
    VERSION(Option<String>),
    STATS(Option<String>, Option<String>),
    LINKS(Option<String>, Option<String>),
    TIME(Option<String>),
    CONNECT(StringStringOption<String>),
    TRACE(Option<String>),
    ADMIN(Option<String>),
    INFO(Option<String>),
    SERVLIST(Option<String>, Option<String>),
    SQUERY(StringString),
    WHO(Option<String>, Option<bool>),
    WHOIS(Option<String>, String),
    WHOWAS(StringOption<String>, Option<String>),
    KILL(StringString),
    PING(StringOption<String>),
    PONG(StringOption<String>),
    ERROR(String),
    AWAY(Option<String>),
    REHASH,
    DIE,
    RESTART,
    SUMMON(StringOption<String>, Option<String>),
    USERS(Option<String>),
    WALLOPS(String),
    USERHOST(Vec<String>),
    ISON(Vec<String>),
    SAJOIN(StringString),
    SAMODE(StringStringOption<String>),
    SANICK(StringString),
    SAPART(StringString),
    SAQUIT(StringString),
    NICKSERV(String),
    CHANSERV(String),
    OPERSERV(String),
    BOTSERV(String),
    HOSTSERV(String),
    MEMOSERV(String),
    CAP(Option<String>, CapSubCommandOption<String>, Option<String>),
    AUTHENTICATE(String),
    ACCOUNT(String),
    METADATA(StringOption<MetadataSubCommand>, Option<Vec<String>>, Option<String>),
    MONITOR(StringOption<String>),
    BATCH(StringOption<BatchSubCommand>, Option<Vec<String>>),
    CHGHOST(StringString),
    Response(ResponseVec<String>, Option<String>),
    Raw(StringVec<String>, Option<String>),
}

List of all client commands as defined in RFC 2812. This also includes commands from the capabilities extension. Additionally, this includes some common additional commands from popular IRCds.

Variants

PASS :password

NICK :nickname

USER user mode * :realname

OPER name :password

MODE nickname modes

SERVICE nickname reserved distribution type reserved :info

QUIT :comment

SQUIT server :comment

JOIN chanlist [chankeys] :[Real name]

PART chanlist :[comment]

MODE channel [modes [modeparams]]

TOPIC channel :[topic]

NAMES [chanlist :[target]]

LIST [chanlist :[target]]

INVITE nickname channel

KICK chanlist userlist :[comment]

PRIVMSG msgtarget :message

Responding to a PRIVMSG

When responding to a message, it is not sufficient to simply copy the message target (msgtarget). This will work just fine for responding to messages in channels where the target is the same for all participants. However, when the message is sent directly to a user, this target will be that client's username, and responding to that same target will actually mean sending itself a response. In such a case, you should instead respond to the user sending the message as specified in the message prefix. Since this is a common pattern, there is a utility function Message::response_target which is used for this exact purpose.

NOTICE msgtarget :message

Responding to a NOTICE

When responding to a notice, it is not sufficient to simply copy the message target (msgtarget). This will work just fine for responding to messages in channels where the target is the same for all participants. However, when the message is sent directly to a user, this target will be that client's username, and responding to that same target will actually mean sending itself a response. In such a case, you should instead respond to the user sending the message as specified in the message prefix. Since this is a common pattern, there is a utility function Message::response_target which is used for this exact purpose.

MOTD :[target]

LUSERS [mask :[target]]

VERSION :[target]

STATS [query :[target]]

LINKS [[remote server] server :mask]

TIME :[target]

CONNECT target server port :[remote server]

TRACE :[target]

ADMIN :[target]

INFO :[target]

SERVLIST [mask :[type]]

SQUERY servicename text

WHO [mask ["o"]]

WHOIS [target] masklist

WHOWAS nicklist [count :[target]]

KILL nickname :comment

PING server1 :[server2]

PONG server :[server2]

ERROR :message

AWAY :[message]

REHASH

DIE

RESTART

SUMMON user [target :[channel]]

USERS :[target]

WALLOPS :Text to be sent

USERHOST space-separated nicklist

ISON space-separated nicklist

SAJOIN nickname channel

SAMODE target modes [modeparams]

SANICK old nickname new nickname

SAPART nickname :comment

SAQUIT nickname :comment

NICKSERV message

CHANSERV message

OPERSERV message

BOTSERV message

HOSTSERV message

MEMOSERV message

CAP [] COMMAND [] :[param]

AUTHENTICATE data

ACCOUNT [account name]

METADATA target COMMAND [params] :[param]

MONITOR command [nicklist]

BATCH (+/-)reference-tag [type [params]]

CHGHOST user host

An IRC response code with arguments and optional suffix.

A raw IRC command unknown to the crate.

Methods

impl Command
[src]

Constructs a new Command.

Trait Implementations

impl Clone for Command
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Command
[src]

Formats the value using the given formatter. Read more

impl PartialEq for Command
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a> From<&'a Command> for String
[src]

Performs the conversion.

impl From<Command> for Message
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for Command

impl Sync for Command