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 if the client could not connect to the given host.

Identify user and join the specified channels

client.identify()?;

Errors if the client could not write to the stream.

Read data coming from the IRC as a Command

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

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

Send a Command to the IRC

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

Errors if the stream could not write.

Helper function for sending PRIVMSGs. This makes

client.send_privmsg("#main", "Hello")?;

equivalent to

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

Helper function for sending JOINs. This makes

client.send_join("#main")?;

equivalent to

client.write_command(Command::JOIN("#main".to_string()))?;

Helper function for sending MODEs. This makes

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

equivalent to

client.write_command(Command::MODE("test".to_string(), Some("+B".to_string())))?;

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.