[][src]Module weechat::config

Weechat configuration for plugins.

Examples

use weechat::Weechat;
use weechat::config::{Config, BooleanOptionSettings, ConfigSectionSettings, BooleanOption};

let mut config = Config::new("my_plugin")
    .expect("Can't create new config");

let server_section_options = ConfigSectionSettings::new("look");
{
    let mut look_section = config.new_section(server_section_options)
        .expect("Can't create new section");

    let use_colors = BooleanOptionSettings::new("use_colors")
        .set_change_callback(move |weechat: &Weechat, option: &BooleanOption| {});

    let use_colors = look_section.new_boolean_option(use_colors);
}

config.read().expect("Can't read config");

Structs

BooleanOption

A config option with a boolean value.

BooleanOptionSettings

Settings for a new boolean option.

ColorOption

A config option with a color value.

ColorOptionSettings

Settings for a new color option.

Conf

The borrowed equivalent of the Config. Will be present in callbacks.

Config

Weechat configuration file

ConfigSection

Weechat Configuration section

ConfigSectionSettings

Represents the options when creating a new config section.

IntegerOption

A config option with a integer value.

IntegerOptionSettings

Settings for a new integer option.

SectionHandle

A handle to a Weechat config section.

SectionHandleMut

A mutable handle to a Weechat config section.

StringOption

A config option with a string value.

StringOptionSettings

Settings for a new string option.

Enums

ConfigOption
OptionChanged

Status for updating options

OptionType

Traits

BaseConfigOption

Base configuration option methods.

ConfigOptions

Marker trait for config options.

ConfigReloadCallback

Trait for the config reload callback.

SectionReadCallback

Trait for the section read callback.

SectionWriteCallback

Trait for the section write callback.

SectionWriteDefaultCallback

Trait for the section write-default callback.