Docs.rs
  • irc-1.1.0
    • irc 1.1.0
    • Permalink
    • Docs.rs crate page
    • MPL-2.0
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • aatxe
    • Dependencies
      • chrono ^0.4.24 normal
      • encoding ^0.2.33 normal optional
      • futures-util ^0.3.30 normal
      • irc-proto ^1.0.0 normal
      • log ^0.4.21 normal
      • native-tls ^0.2.11 normal optional
      • parking_lot ^0.12.1 normal
      • pin-project ^1.0.12 normal
      • rustls-native-certs ^0.8 normal optional
      • rustls-pemfile ^2 normal optional
      • serde ^1.0.160 normal optional
      • serde_json ^1.0.95 normal optional
      • serde_yaml ^0.9.21 normal optional
      • thiserror ^1.0.58 normal
      • tokio ^1.27.0 normal
      • tokio-native-tls ^0.3.1 normal optional
      • tokio-rustls ^0.26.0 normal optional
      • tokio-socks ^0.5.1 normal optional
      • tokio-stream ^0.1.12 normal
      • tokio-util ^0.7.7 normal
      • toml ^0.7.3 normal optional
      • webpki-roots ^0.26.0 normal optional
      • anyhow ^1.0.81 dev
      • args ^2.2.0 dev
      • env_logger ^0.11.0 dev
      • futures ^0.3.30 dev
      • getopts ^0.2.21 dev
      • tokio ^1.27.0 dev
    • Versions
    • 100% of the crate is documented
  • Platform
    • i686-pc-windows-msvc
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate irc

irc1.1.0

  • All Items

Sections

  • Quick Start
  • A Whirlwind Tour
  • Example

Crate Items

  • Re-exports
  • Modules

Crates

  • irc

Crate irc

Source
Expand description

A simple, thread-safe, and async-friendly library for IRC clients.

§Quick Start

The main public API is entirely exported in client::prelude. This should include everything necessary to write an IRC client or bot.

§A Whirlwind Tour

The irc crate is divided into two main modules: client and proto. As the names suggest, the client module captures the whole of the client-side functionality, while the proto module features general components of an IRC protocol implementation that could in principle be used in either client or server software. Both modules feature a number of components that are low-level and can be used to build alternative APIs for the IRC protocol. For the average user, the higher-level components for an IRC client are all re-exported in client::prelude. That module serves as the best starting point for a new user trying to understand the high-level API.

§Example

use irc::client::prelude::*;
use futures::prelude::*;

// configuration is loaded from config.toml into a Config
let mut client = Client::new("config.toml").await?;
// identify comes from ClientExt
client.identify()?;

let mut stream = client.stream()?;

while let Some(message) = stream.next().await.transpose()? {
    if let Command::PRIVMSG(channel, message) = message.command {
        if message.contains(&*client.current_nickname()) {
            // send_privmsg comes from ClientExt
            client.send_privmsg(&channel, "beep boop").unwrap();
        }
    }
}

Re-exports§

pub extern crate irc_proto as proto;

Modules§

client
A simple, thread-safe, and async-friendly IRC client library.
error
Errors for irc crate using failure.

Results

Settings
Help
    struct
    irc::client::Client
    The canonical implementation of a connection to an IRC …
    module
    irc::client
    A simple, thread-safe, and async-friendly IRC client …
    struct
    irc::client::ClientStream
    A stream of Messages received from an IRC server via an …
    method
    irc::client::data::config::Config::client_cert_pass
    Gets the password to the client authentication certificate.
    struct field
    irc::client::data::config::Config::client_cert_pass
    The password for the certificate to use in CertFP …
    method
    irc::client::data::config::Config::client_cert_path
    Gets the path to the client authentication certificate in …
    struct field
    irc::client::data::config::Config::client_cert_path
    The path to a TLS certificate to use for CertFP client …
    enum variant
    irc::client::prelude::Response::RPL_LUSERCLIENT
    …
    method
    irc::client::Client::sender
    &Client -> Sender
    Get access to a thread-safe sender that can be used with …
    method
    irc::client::Client::identify
    &Client -> Result<()>
    Sends a CAP END, NICK and USER to identify.
    method
    irc::client::Client::send_sasl_abort
    &Client -> Result<()>
    Sends a SASL AUTHENTICATE request to abort authentication.
    method
    irc::client::Client::send_sasl_plain
    &Client -> Result<()>
    Sends a SASL AUTHENTICATE request to use the PLAIN …
    method
    irc::client::Client::current_nickname
    &Client -> &str
    Gets the current nickname in use. This may be the primary …
    method
    irc::client::Client::send_sasl_external
    &Client -> Result<()>
    Sends a SASL AUTHENTICATE request to use the EXTERNAL …
    method
    irc::client::Client::stream
    &mut Client -> Result<ClientStream>
    Gets a stream of incoming messages from the Client’s …
    method
    irc::client::Client::outgoing
    &mut Client -> Option<Outgoing>
    Take the outgoing future in order to drive it yourself.
    method
    irc::client::Client::send_cap_ls
    &Client, NegotiationVersion -> Result<()>
    Sends a request for a list of server capabilities for a …
    method
    irc::client::Client::list_channels
    &Client -> Option<Vec<String>>
    Gets a list of currently joined channels. This will be None…
    method
    irc::client::Client::fmt
    &Client, &mut Formatter -> Result
    method
    irc::client::Client::send_join
    &Client, S -> Result<()>
    Joins the specified channel or chanlist.
    method
    irc::client::Client::send_part
    &Client, S -> Result<()>
    Parts the specified channel or chanlist.
    method
    irc::client::Client::send_pong
    &Client, S -> Result<()>
    Sends a PONG with the specified message.
    method
    irc::client::Client::send_quit
    &Client, S -> Result<()>
    Quits the server entirely with a message. This defaults to …
    method
    irc::client::Client::send_sasl
    &Client, S -> Result<()>
    Sends a SASL AUTHENTICATE message with the specified data.
    method
    irc::client::Client::send_time
    &Client, S -> Result<()>
    Sends a time request to the specified target. This …
    method
    irc::client::Client::send_finger
    &Client, S -> Result<()>
    Sends a finger request to the specified target. This …
    method
    irc::client::Client::send_source
    &Client, S -> Result<()>
    Sends a source request to the specified target. This …
    method
    irc::client::Client::send_version
    &Client, S -> Result<()>
    Sends a version request to the specified target. This …
    method
    irc::client::Client::send_ctcp_ping
    &Client, S -> Result<()>
    Sends a finger request to the specified target. This …
    method
    irc::client::Client::send_user_info
    &Client, S -> Result<()>
    Sends a user info request to the specified target. This …
    method
    irc::client::Client::send
    &Client, M -> Result<()>
    Sends a Command as this Client. This is the core primitive …
    method
    irc::client::Client::list_users
    &Client, &str -> Option<Vec<User>>
    Gets a list of [Users] in the specified channel. If the …
    method
    irc::client::Client::send_cap_req
    &Client, &[Capability] -> Result<()>
    Sends an IRCv3 capabilities request for the specified …
    method
    irc::client::Client::send_ctcp
    &Client, S1, S2 -> Result<()>
    Sends a CTCP-escaped message to the specified target. This …
    method
    irc::client::Client::send_kill
    &Client, S1, S2 -> Result<()>
    Kills the target with the provided message.
    method
    irc::client::Client::send_oper
    &Client, S1, S2 -> Result<()>
    Attempts to oper up using the specified username and …
    method
    irc::client::Client::send_topic
    &Client, S1, S2 -> Result<()>
    Sets the topic of a channel or requests the current one. …
    method
    irc::client::Client::send_action
    &Client, S1, S2 -> Result<()>
    Sends an action command to the specified target. This …
    method
    irc::client::Client::send_invite
    &Client, S1, S2 -> Result<()>
    Invites a user to the specified channel.
    method
    irc::client::Client::send_notice
    &Client, S1, S2 -> Result<()>
    Sends a notice to the specified target.
    method
    irc::client::Client::send_sanick
    &Client, S1, S2 -> Result<()>
    Forces a user to change from the old nickname to the new …
    method
    irc::client::Client::send_privmsg
    &Client, S1, S2 -> Result<()>
    Sends a message to the specified target. If the message …
    method
    irc::client::Client::send_join_with_keys
    &Client, S1, S2 -> Result<()>
    Joins the specified channel or chanlist using the …
    method
    irc::client::Client::send_kick
    &Client, S1, S2, S3 -> Result<()>
    Kicks the listed nicknames from the listed channels with a …
    method
    irc::client::Client::send_samode
    &Client, S1, S2, S3 -> Result<()>
    Changes the mode of the target by force. If modeparams is …
    method
    irc::client::Client::send_mode
    &Client, S, &[Mode<T>] -> Result<()>
    Changes the modes for the specified target.
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.