[−][src]Struct weechat::config::BooleanOptionSettings
Settings for a new boolean option.
Implementations
impl BooleanOptionSettings
[src]
pub fn new<N: Into<String>>(name: N) -> Self
[src]
Create new settings that can be used to create a new boolean option.
Arguments
name
- The name of the new option.
pub fn description<D: Into<String>>(self, descritpion: D) -> Self
[src]
pub fn default_value(self, value: bool) -> 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, &BooleanOption) + 'static
) -> Self
[src]
self,
callback: impl FnMut(&Weechat, &BooleanOption) + '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::BooleanOptionSettings; let settings = BooleanOptionSettings::new("autoconnect") .set_change_callback(|weechat, option| { Weechat::print("Option changed"); });
Trait Implementations
impl Default for BooleanOptionSettings
[src]
fn default() -> BooleanOptionSettings
[src]
Auto Trait Implementations
impl !RefUnwindSafe for BooleanOptionSettings
impl !Send for BooleanOptionSettings
impl !Sync for BooleanOptionSettings
impl Unpin for BooleanOptionSettings
impl !UnwindSafe for BooleanOptionSettings
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>,