[][src]Struct weechat::config::ColorOptionSettings

pub struct ColorOptionSettings { /* fields omitted */ }

Settings for a new color option.

Implementations

impl ColorOptionSettings[src]

pub fn new<N: Into<String>>(name: N) -> Self[src]

Create new settings that can be used to create a new color option.

Arguments

  • name - The name of the new option.

pub fn description<D: Into<String>>(self, descritpion: D) -> Self[src]

Set the description of the option.

Arguments

  • description - The description of the new option.

pub fn default_value<V: Into<String>>(self, value: V) -> Self[src]

Set the default value of the option.

This is the value the option will have if it isn't set by the user. If the option is reset, the option will take this value.

Arguments

  • value - The value that should act as the default value.

pub fn set_change_callback(
    self,
    callback: impl FnMut(&Weechat, &ColorOption<'_>) + 'static
) -> Self
[src]

Set the callback that will run when the value of the option changes.

Arguments

  • callback - The callback that will be run.

Examples

use weechat::Weechat;
use weechat::config::ColorOptionSettings;

let settings = ColorOptionSettings::new("address")
    .set_change_callback(|weechat, option| {
        Weechat::print("Option changed");
    });

Trait Implementations

impl Default for ColorOptionSettings[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.