Skip to main content

Command

Enum Command 

Source
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

Fields

ยงusername: String
ยงrealname: String
ยง

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

Fields

ยงchannel: String
ยง

Names(Vec<String>)

NAMES command - list channel members

ยง

List(Option<Vec<String>>)

LIST command - list channels

ยง

Privmsg

PRIVMSG command - send message

Fields

ยงtarget: String
ยงmessage: String
ยง

Notice

NOTICE command - send notice

Fields

ยงtarget: String
ยงmessage: String
ยง

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

Fields

ยงchannel: String
ยง

Mode

MODE command - change modes

Fields

ยงtarget: String
ยงparams: Vec<String>
ยง

Invite

INVITE command - invite user to channel

Fields

ยงchannel: String
ยง

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

Fields

ยงsubcommand: String
ยงparams: Vec<String>
ยง

Authenticate(String)

AUTHENTICATE command - SASL authentication

ยง

Account(String)

ACCOUNT command - account notification

ยง

Monitor

MONITOR command - nickname monitoring

Fields

ยงsubcommand: String
ยงtargets: Vec<String>
ยง

Metadata

METADATA command - user metadata

Fields

ยงtarget: String
ยงsubcommand: String
ยงparams: Vec<String>
ยง

TagMsg

TAGMSG command - tag-only message

Fields

ยงtarget: String
ยง

Batch

BATCH command - message batching

Fields

ยงreference: String
ยงbatch_type: Option<String>
ยงparams: Vec<String>
ยง

Redact

REDACT command - message redaction

Fields

ยงtarget: String
ยง

MarkRead

MARKREAD command - mark messages as read

Fields

ยงtarget: String
ยงtimestamp: Option<String>
ยง

SetName

SETNAME command - change real name

Fields

ยงrealname: String
ยง

ChatHistory

CHATHISTORY command - request chat history

Fields

ยงsubcommand: String
ยงtarget: String
ยงparams: Vec<String>
ยง

Oper

OPER command - gain operator privileges

Fields

ยงpassword: String
ยง

Kill

KILL command - forcibly disconnect user

Fields

ยงreason: String
ยง

Rehash

REHASH command - reload server configuration

ยง

Restart

RESTART command - restart server

ยง

Die

DIE command - shutdown server

ยง

CtcpRequest

CTCP request

Fields

ยงtarget: String
ยงcommand: String
ยงparams: String
ยง

CtcpResponse

CTCP response

Fields

ยงtarget: String
ยงcommand: String
ยงparams: String
ยง

Unknown(String, Vec<String>)

Unknown command

Implementationsยง

Sourceยง

impl Command

Source

pub fn parse(command: &str, params: Vec<String>) -> Self

Parse a command from its string representation and parameters

Source

pub fn command_name(&self) -> &str

Get the command name as a string

Source

pub fn is_channel_command(&self) -> bool

Check if this is a channel-related command

Source

pub fn is_message_command(&self) -> bool

Check if this is a messaging command

Source

pub fn is_ircv3_command(&self) -> bool

Check if this is an IRCv3 command

Trait Implementationsยง

Sourceยง

impl Clone for Command

Sourceยง

fn clone(&self) -> Command

Returns a duplicate 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<'de> Deserialize<'de> for Command

Sourceยง

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl PartialEq for Command

Sourceยง

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 ยท Sourceยง

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Sourceยง

impl Serialize for Command

Sourceยง

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl Eq for Command

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> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dest: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Sourceยง

type Output = T

Should always be Self
Sourceยง

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

Sourceยง

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>,

Sourceยง

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>,

Sourceยง

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Sourceยง

fn vzip(self) -> V

Sourceยง

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,