Struct 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)?;
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()?;
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() {
    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.

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()))?;
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")?;
Errors

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

Helper function for setting the users status to AWAY

client.away("AFK")?;
Errors

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

Helper function for sending PRIVMSGs.

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

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

Helper function to INVITE people to a channels

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

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

Helper function for sending JOINs.

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

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

Helper function for LISTing channels and modes

client.list(None, None)?;
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)?;
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")?;
Errors

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

Helper function for sending MODEs.

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

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

Helper function for leaving channels.

client.part("#main")?;
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"))?;
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)?;
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.

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.