pub enum Command {
Show 44 variants
Nick(String),
User {
username: String,
realname: String,
},
Pass(String),
Quit(Option<String>),
Ping(String),
Pong(String),
Join(Vec<String>, Vec<String>),
Part(Vec<String>, Option<String>),
Topic {
channel: String,
topic: Option<String>,
},
Names(Vec<String>),
List(Option<Vec<String>>),
Privmsg {
target: String,
message: String,
},
Notice {
target: String,
message: String,
},
Who(Option<String>),
Whois(Vec<String>),
Whowas(String, Option<i32>),
Query(String),
Kick {
channel: String,
user: String,
reason: Option<String>,
},
Mode {
target: String,
modes: Option<String>,
params: Vec<String>,
},
Invite {
nick: String,
channel: String,
},
Motd(Option<String>),
Version(Option<String>),
Stats(Option<String>, Option<String>),
Time(Option<String>),
Info(Option<String>),
Cap {
subcommand: String,
params: Vec<String>,
},
Authenticate(String),
Account(String),
Monitor {
subcommand: String,
targets: Vec<String>,
},
Metadata {
target: String,
subcommand: String,
params: Vec<String>,
},
TagMsg {
target: String,
},
Batch {
reference: String,
batch_type: Option<String>,
params: Vec<String>,
},
Redact {
target: String,
msgid: String,
reason: Option<String>,
},
MarkRead {
target: String,
timestamp: Option<String>,
},
SetName {
realname: String,
},
ChatHistory {
subcommand: String,
target: String,
params: Vec<String>,
},
Oper {
name: String,
password: String,
},
Kill {
nick: String,
reason: String,
},
Rehash,
Restart,
Die,
CtcpRequest {
target: String,
command: String,
params: String,
},
CtcpResponse {
target: String,
command: String,
params: String,
},
Unknown(String, Vec<String>),
}Expand description
Represents various IRC commands with their parameters
Variantsยง
Nick(String)
NICK command - set nickname
User
USER command - user registration
Pass(String)
PASS command - connection password
Quit(Option<String>)
QUIT command - disconnect
Ping(String)
PING command - server ping
Pong(String)
PONG command - ping response
Join(Vec<String>, Vec<String>)
JOIN command - join channels
Part(Vec<String>, Option<String>)
PART command - leave channels
Topic
TOPIC command - get/set channel topic
Names(Vec<String>)
NAMES command - list channel members
List(Option<Vec<String>>)
LIST command - list channels
Privmsg
PRIVMSG command - send message
Notice
NOTICE command - send notice
Who(Option<String>)
WHO command - query user information
Whois(Vec<String>)
WHOIS command - detailed user information
Whowas(String, Option<i32>)
WHOWAS command - historical user information
Query(String)
QUERY command - open private message window
Kick
KICK command - remove user from channel
Mode
MODE command - change modes
Invite
INVITE command - invite user to channel
Motd(Option<String>)
MOTD command - message of the day
Version(Option<String>)
VERSION command - server version
Stats(Option<String>, Option<String>)
STATS command - server statistics
Time(Option<String>)
TIME command - server time
Info(Option<String>)
INFO command - server information
Cap
CAP command - capability negotiation
Authenticate(String)
AUTHENTICATE command - SASL authentication
Account(String)
ACCOUNT command - account notification
Monitor
MONITOR command - nickname monitoring
Metadata
METADATA command - user metadata
TagMsg
TAGMSG command - tag-only message
Batch
BATCH command - message batching
Redact
REDACT command - message redaction
MarkRead
MARKREAD command - mark messages as read
SetName
SETNAME command - change real name
ChatHistory
CHATHISTORY command - request chat history
Oper
OPER command - gain operator privileges
Kill
KILL command - forcibly disconnect user
Rehash
REHASH command - reload server configuration
Restart
RESTART command - restart server
Die
DIE command - shutdown server
CtcpRequest
CTCP request
CtcpResponse
CTCP response
Unknown(String, Vec<String>)
Unknown command
Implementationsยง
Sourceยงimpl Command
impl Command
Sourcepub fn parse(command: &str, params: Vec<String>) -> Self
pub fn parse(command: &str, params: Vec<String>) -> Self
Parse a command from its string representation and parameters
Sourcepub fn command_name(&self) -> &str
pub fn command_name(&self) -> &str
Get the command name as a string
Sourcepub fn is_channel_command(&self) -> bool
pub fn is_channel_command(&self) -> bool
Check if this is a channel-related command
Sourcepub fn is_message_command(&self) -> bool
pub fn is_message_command(&self) -> bool
Check if this is a messaging command
Sourcepub fn is_ircv3_command(&self) -> bool
pub fn is_ircv3_command(&self) -> bool
Check if this is an IRCv3 command