Struct async_circe::Client[][src]

pub struct Client { /* fields omitted */ }
Expand description

An IRC client

Implementations

Creates a new client with a given Config.

Example
let mut client = Client::new(config).await?;
Errors

Returns error if the client could not connect to the host.

Panics

Panics if the client can’t connect to the given host.

Identify user and joins the in the Config specified channels.

Example
client.identify().await?;
Errors

Returns error if the client could not write to the stream.

Read data coming from the IRC as a commands::Command.

Example
loop {
   if let Some(ref command) = client.read().await? {
       if let commands::Command::PRIVMSG(nick, channel, message) = command {
           println!("{} in {}: {}", nick, channel, message);
       }
   }
}
Errors

Returns IO errors from the TcpStream.

Request information about the admin of a given server.

Example
client.admin("libera.chat").await?;
Errors

Returns IO errors from the TcpStream.

Set the status of the client.

Example
client.away("afk").await?;
Errors

Returns IO errors from the TcpStream.

Invite someone to a channel.

Example
client.invite("liblemonirc", "#async-circe").await?;
Errors

Returns IO errors from the TcpStream.

Join a channel.

Example
client.join("#chaos").await?;
Errors

Returns IO errors from the TcpStream.

List available channels on an IRC, or users in a channel.

Example
client.list(None, None).await?;
Errors

Returns IO errors from the TcpStream.

Set the mode for a user.

Example
client.mode("test", Some("+B")).await?;
Errors

Returns IO errors from the TcpStream.

Get all the people online in channels.

Example
client.names("#chaos,#async-circe", None).await?;
Errors

Returns IO errors from the TcpStream.

Change your nickname on a server.

Example
client.nick("Not async-circe").await?;
Errors

Returns IO errors from the TcpStream.

Authentificate as an operator on a server.

Example
client.oper("username", "password").await?;
Errors

Returns IO errors from the TcpStream.

Leave a channel.

Example
client.part("#chaos").await?;
Errors

Returns IO errors from the TcpStream.

Tests the presence of a connection to a server.

Example
client.ping("libera.chat", None).await?;
Errors

Returns IO errors from the TcpStream.

Send a message to a channel.

Example
client.privmsg("#chaos", "Hello").await?;
Errors

Returns IO errors from the TcpStream.

Leave the IRC server you are connected to.

Example
client.quit(None).await?;
Errors

Returns IO errors from the TcpStream.

Get the topic of a channel.

Example
client.topic("#chaos", None).await?;

Set the topic of a channel.

Example
client.topic("#chaos", Some("CHAOS")).await?;
Errors

Returns IO errors from the TcpStream.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

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

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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