Struct async_circe::Client[][src]

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

An IRC client

Implementations

Creates a new client with a given Config.

let mut client = Client::new(config).await.unwrap()?;
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.

client.identify()?.await.unwrap();
Errors

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

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

if let Ok(ref command) = client.read().await {
    if let Command::OTHER(line) = command {
        print!("{}", line);
    }
}
Errors

Returns error if there are no new messages. This should not be taken as an actual error, because nothing went wrong.

👎 Deprecated

Send a commands::Command to the IRC.
Not reccomended to use, use the helper functions instead.

client.write_command(Command::PRIVMSG("".to_string(), "#main".to_string(), "Hello".to_string())).await?;
Errors

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

Helper function for requesting information about the ADMIN of an IRC server

client.admin("192.168.178.100").await?;
Errors

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

Helper function for setting the users status to AWAY

client.away("AFK").await?;
Errors

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

Helper function to INVITE people to a channels

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

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

Helper function for sending JOINs.

client.join("#main").await?;
Errors

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

Helper function for LISTing channels and modes

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

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

Helper function for sending MODEs.

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

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

Helper function for getting all nicknames in a channel

client.names("#main,#circe", None).await?;
Errors

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

Helper function for changeing your nick

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

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

Helper function to try to register as a channel operator

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

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

Helper function for leaving channels.

client.part("#main").await?;
Errors

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

Tests the presence of a connection.

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

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

Helper function for sending PRIVMSGs.

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

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

Helper function for leaving the IRC server and shutting down the TCP stream afterwards.

client.quit(None).await?;
Errors

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

Helper function for setting or getting the topic of a channel

client.topic("#main", Some("main channel")).await?;
Errors

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

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