Struct hiirc::Settings
[−]
[src]
pub struct Settings<'a> { pub addr: &'a str, pub nickname: &'a str, pub username: &'a str, pub realname: &'a str, pub reconnection: ReconnectionSettings, pub monitor: Option<MonitorSettings>, pub auto_ident: bool, pub auto_ping: bool, pub encoding: EncodingRef, pub password: &'a str, }
Settings for the dispatcher.
Fields
addr: &'a str
Address of the irc server.
nickname: &'a str
Preferred nickname.
username: &'a str
Username.
realname: &'a str
Real name.
reconnection: ReconnectionSettings
Reconnection settings. If None, reconnection is disabled.
monitor: Option<MonitorSettings>
Monitor settings. If None, monitoring is disabled.
auto_ident: bool
Automatically identify after reconnection.
auto_ping: bool
Automatically reply to ping requests.
encoding: EncodingRef
Encoding used for the connection.
password: &'a str
Server password
Methods
impl<'a> Settings<'a>
[src]
fn new<'b>(addr: &'b str, nickname: &'b str) -> Settings<'b>
Create new settings with sensible default values.
The default values are:
username: "hiirc", realname: "hiirc", reconnection: ReonnectionSettings::DoNotReconnect, monitor: None, auto_ident: true, auto_ping: true, encoding: UTF_8,
fn username(self, username: &'a str) -> Settings<'a>
Modify the username.
fn realname(self, realname: &'a str) -> Settings<'a>
Modify the realname.
fn reconnection(self, reconnection: ReconnectionSettings) -> Settings<'a>
Modify the reconnection settings.
fn monitor(self, monitor: Option<MonitorSettings>) -> Settings<'a>
Modify the monitor settings.
fn auto_ident(self, auto_ident: bool) -> Settings<'a>
Enable/disable automatic indentification.
fn auto_ping(self, auto_ping: bool) -> Settings<'a>
Enable/disable automatic ping replies.
fn encoding(self, encoding: EncodingRef) -> Settings<'a>
Modify the encoding used for this connection.
fn password(self, password: &'a str) -> Settings<'a>
Modify the server password.
fn dispatch<L>(self, listener: L) -> Result<(), Error> where
L: Listener,
L: Listener,
Connect to the server and begin dispatching events using the given Listener
.