[][src]Enum irc_proto::command::Command

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(Vec<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>>),
    MONITOR(StringOption<String>),
    BATCH(StringOption<BatchSubCommand>, Option<Vec<String>>),
    CHGHOST(StringString),
    Response(ResponseVec<String>),
    Raw(StringVec<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(String)

PASS :password

NICK(String)

NICK :nickname

USER(StringStringString)

USER user mode * :realname

OPER(StringString)

OPER name :password

UserMODE(StringVec<Mode<UserMode>>)

MODE nickname modes

SERVICE(StringStringStringStringStringString)

SERVICE nickname reserved distribution type reserved :info

QUIT(Option<String>)

QUIT :comment

SQUIT(StringString)

SQUIT server :comment

JOIN chanlist [chankeys] :[Real name]

PART chanlist :[comment]

ChannelMODE(StringVec<Mode<ChannelMode>>)

MODE channel [modes [modeparams]]

TOPIC(StringOption<String>)

TOPIC channel :[topic]

NAMES [chanlist :[target]]

LIST [chanlist :[target]]

INVITE(StringString)

INVITE nickname channel

KICK chanlist userlist :[comment]

PRIVMSG(StringString)

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(StringString)

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(Option<String>)

MOTD :[target]

LUSERS [mask :[target]]

VERSION(Option<String>)

VERSION :[target]

STATS [query :[target]]

LINKS [[remote server] server :mask]

TIME(Option<String>)

TIME :[target]

CONNECT(StringStringOption<String>)

CONNECT target server port :[remote server]

TRACE(Option<String>)

TRACE :[target]

ADMIN(Option<String>)

ADMIN :[target]

INFO(Option<String>)

INFO :[target]

SERVLIST(Option<String>, Option<String>)

SERVLIST [mask :[type]]

SQUERY(StringString)

SQUERY servicename text

WHO [mask ["o"]]

WHOIS(Option<String>, String)

WHOIS [target] masklist

WHOWAS nicklist [count :[target]]

KILL(StringString)

KILL nickname :comment

PING server1 :[server2]

PONG server :[server2]

ERROR(String)

ERROR :message

AWAY(Option<String>)

AWAY :[message]

REHASH

REHASH

DIE

DIE

RESTART

RESTART

SUMMON user [target :[channel]]

USERS(Option<String>)

USERS :[target]

WALLOPS(String)

WALLOPS :Text to be sent

USERHOST(Vec<String>)

USERHOST space-separated nicklist

ISON(Vec<String>)

ISON space-separated nicklist

SAJOIN(StringString)

SAJOIN nickname channel

SAMODE(StringStringOption<String>)

SAMODE target modes [modeparams]

SANICK(StringString)

SANICK old nickname new nickname

SAPART(StringString)

SAPART nickname :comment

SAQUIT(StringString)

SAQUIT nickname :comment

NICKSERV(Vec<String>)

NICKSERV message

CHANSERV(String)

CHANSERV message

OPERSERV(String)

OPERSERV message

BOTSERV(String)

BOTSERV message

HOSTSERV(String)

HOSTSERV message

MEMOSERV(String)

MEMOSERV message

CAP [] COMMAND [] :[param]

AUTHENTICATE(String)

AUTHENTICATE data

ACCOUNT(String)

ACCOUNT [account name]

METADATA target COMMAND [params] :[param]

MONITOR(StringOption<String>)

MONITOR command [nicklist]

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

CHGHOST(StringString)

CHGHOST user host

Response(ResponseVec<String>)

An IRC response code with arguments and optional suffix.

Raw(StringVec<String>)

A raw IRC command unknown to the crate.

Implementations

impl Command[src]

pub fn new(cmd: &str, args: Vec<&str>) -> Result<Command, MessageParseError>[src]

Constructs a new Command.

Trait Implementations

impl Clone for Command[src]

impl Debug for Command[src]

impl From<Command> for Message[src]

impl PartialEq<Command> for Command[src]

impl StructuralPartialEq for Command[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.