[−][src]Struct weechat::config::ColorOptionSettings
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]
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]
self,
callback: impl FnMut(&Weechat, &ColorOption<'_>) + 'static
) -> Self
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]
fn default() -> ColorOptionSettings
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ColorOptionSettings
impl !Send for ColorOptionSettings
impl !Sync for ColorOptionSettings
impl Unpin for ColorOptionSettings
impl !UnwindSafe for ColorOptionSettings
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,