[][src]Module irc::client::prelude

A client-side IRC prelude, re-exporting the complete high-level IRC client API.

Structure

A connection to an IRC server is created via an IrcClient which is configured using a Config struct that defines data such as which server to connect to, on what port, and using what nickname. The Client trait provides an API for actually interacting with the server once a connection has been established. This API intentionally offers only a single method to send Commands because it makes it easy to see the whole set of possible interactions with a server. The ClientExt trait addresses this deficiency by defining a number of methods that provide a more clear and succinct interface for sending various common IRC commands to the server. An IrcReactor can be used to create and manage multiple IrcClients with more fine-grained control over error management.

The various proto types capture details of the IRC protocol that are used throughout the client API. Message, Command, and Response are used to send and receive messages along the connection, and are naturally at the heart of communication in the IRC protocol. Capability and NegotiationVersion are used to determine (with the server) what IRCv3 functionality to enable for the connection. Certain parts of the API offer suggestions for extensions that will improve the user experience, and give examples of how to enable them using Capability. Mode, ChannelMode, and UserMode are used in a high-level API for dealing with IRC channel and user modes. They appear in methods for sending mode commands, as well as in the parsed form of received mode commands.

Re-exports

pub use crate::client::data::Config;
pub use crate::client::Client;
pub use crate::client::Sender;

Structs

Message

A data structure representing an IRC message according to the protocol specification. It consists of a collection of IRCv3 tags, a prefix (describing the source of the message), and the protocol command. If the command is unknown, it is treated as a special raw command that consists of a collection of arguments and the special suffix argument. Otherwise, the command is parsed into a more useful form as described in Command.

Enums

Capability

List of all supported IRCv3 capability extensions from the IRCv3 specifications.

ChannelMode

Channel modes for the MODE command.

Command

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.

Mode

A mode argument for the MODE command.

NegotiationVersion

List of IRCv3 capability negotiation versions.

Prefix

The Prefix indicates "the true origin of the message", according to the server.

Response

List of all server responses as defined in RFC 2812 and Modern docs (henceforth referred to as Modern). All commands are documented with their expected form from the RFC, and any useful, additional information about the response code.

UserMode

User modes for the MODE command.

Traits

ChannelExt

An extension trait giving strings a function to check if they are a channel.