pub enum Command {
Show 66 variants PASS(String), NICK(String), USER(String, String, String), OPER(String, String), UserMODE(String, Vec<Mode<UserMode>>), SERVICE(String, String, String, String, String, String), QUIT(Option<String>), SQUIT(String, String), JOIN(String, Option<String>, Option<String>), PART(String, Option<String>), ChannelMODE(String, Vec<Mode<ChannelMode>>), TOPIC(String, Option<String>), NAMES(Option<String>, Option<String>), LIST(Option<String>, Option<String>), INVITE(String, String), KICK(String, String, Option<String>), PRIVMSG(String, String), NOTICE(String, String), 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(String, String, Option<String>), TRACE(Option<String>), ADMIN(Option<String>), INFO(Option<String>), SERVLIST(Option<String>, Option<String>), SQUERY(String, String), WHO(Option<String>, Option<bool>), WHOIS(Option<String>, String), WHOWAS(String, Option<String>, Option<String>), KILL(String, String), PING(String, Option<String>), PONG(String, Option<String>), ERROR(String), AWAY(Option<String>), REHASH, DIE, RESTART, SUMMON(String, Option<String>, Option<String>), USERS(Option<String>), WALLOPS(String), USERHOST(Vec<String>), ISON(Vec<String>), SAJOIN(String, String), SAMODE(String, String, Option<String>), SANICK(String, String), SAPART(String, String), SAQUIT(String, String), NICKSERV(Vec<String>), CHANSERV(String), OPERSERV(String), BOTSERV(String), HOSTSERV(String), MEMOSERV(String), CAP(Option<String>, CapSubCommand, Option<String>, Option<String>), AUTHENTICATE(String), ACCOUNT(String), METADATA(String, Option<MetadataSubCommand>, Option<Vec<String>>), MONITOR(String, Option<String>), BATCH(String, Option<BatchSubCommand>, Option<Vec<String>>), CHGHOST(String, String), Response(Response, Vec<String>), Raw(String, Vec<String>),
}
Expand description

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

USER user mode * :realname

§

OPER(String, String)

OPER name :password

§

UserMODE(String, Vec<Mode<UserMode>>)

MODE nickname modes

§

SERVICE(String, String, String, String, String, String)

SERVICE nickname reserved distribution type reserved :info

§

QUIT(Option<String>)

QUIT :comment

§

SQUIT(String, String)

SQUIT server :comment

§

JOIN(String, Option<String>, Option<String>)

JOIN chanlist [chankeys] :[Real name]

§

PART(String, Option<String>)

PART chanlist :[comment]

§

ChannelMODE(String, Vec<Mode<ChannelMode>>)

MODE channel [modes [modeparams]]

§

TOPIC(String, Option<String>)

TOPIC channel :[topic]

§

NAMES(Option<String>, Option<String>)

NAMES [chanlist :[target]]

§

LIST(Option<String>, Option<String>)

LIST [chanlist :[target]]

§

INVITE(String, String)

INVITE nickname channel

§

KICK(String, String, Option<String>)

KICK chanlist userlist :[comment]

§

PRIVMSG(String, String)

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

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

LUSERS [mask :[target]]

§

VERSION(Option<String>)

VERSION :[target]

§

STATS(Option<String>, Option<String>)

STATS [query :[target]]

LINKS [[remote server] server :mask]

§

TIME(Option<String>)

TIME :[target]

§

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

SQUERY servicename text

§

WHO(Option<String>, Option<bool>)

WHO [mask [“o”]]

§

WHOIS(Option<String>, String)

WHOIS [target] masklist

§

WHOWAS(String, Option<String>, Option<String>)

WHOWAS nicklist [count :[target]]

§

KILL(String, String)

KILL nickname :comment

§

PING(String, Option<String>)

PING server1 :[server2]

§

PONG(String, Option<String>)

PONG server :[server2]

§

ERROR(String)

ERROR :message

§

AWAY(Option<String>)

AWAY :[message]

§

REHASH

REHASH

§

DIE

DIE

§

RESTART

RESTART

§

SUMMON(String, Option<String>, Option<String>)

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

SAJOIN nickname channel

§

SAMODE(String, String, Option<String>)

SAMODE target modes [modeparams]

§

SANICK(String, String)

SANICK old nickname new nickname

§

SAPART(String, String)

SAPART nickname :comment

§

SAQUIT(String, String)

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

CAP [] COMMAND [] :[param]

§

AUTHENTICATE(String)

AUTHENTICATE data

§

ACCOUNT(String)

ACCOUNT [account name]

§

METADATA(String, Option<MetadataSubCommand>, Option<Vec<String>>)

METADATA target COMMAND [params] :[param]

§

MONITOR(String, Option<String>)

MONITOR command [nicklist]

§

BATCH(String, Option<BatchSubCommand>, Option<Vec<String>>)

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

§

CHGHOST(String, String)

CHGHOST user host

§

Response(Response, Vec<String>)

An IRC response code with arguments and optional suffix.

§

Raw(String, Vec<String>)

A raw IRC command unknown to the crate.

Implementations§

source§

impl Command

source

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

Constructs a new Command.

Trait Implementations§

source§

impl Clone for Command

source§

fn clone(&self) -> Command

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Command

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> From<&'a Command> for String

source§

fn from(cmd: &'a Command) -> String

Converts to this type from the input type.
source§

impl From<Command> for Message

source§

fn from(cmd: Command) -> Message

Converts to this type from the input type.
source§

impl PartialEq for Command

source§

fn eq(&self, other: &Command) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Command

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more