[−][src]Struct weechat::config::ConfigSectionSettings
Represents the options when creating a new config section.
Implementations
impl ConfigSectionSettings
[src]
pub fn new<P: Into<String>>(name: P) -> Self
[src]
Create a new config section info. This can be passed to a config which will create a new ConfigSection.
#Arguments
name
- The name that the section should get.
pub fn set_read_callback(self, callback: impl SectionReadCallback) -> Self
[src]
Set the function that will be called when an option from the section is read from the disk.
#Arguments
callback
- The callback for a section read operation.
Examples
use weechat::Weechat; use weechat::config::{Conf, ConfigSection, ConfigSectionSettings, OptionChanged}; let server_section_options = ConfigSectionSettings::new("server") .set_read_callback(|_: &Weechat, config: &Conf, section: &mut ConfigSection, option_name: &str, option_value: &str| { Weechat::print("Writing section"); OptionChanged::Changed });
pub fn set_write_callback(
self,
callback: impl FnMut(&Weechat, &Conf, &mut ConfigSection) + 'static
) -> Self
[src]
self,
callback: impl FnMut(&Weechat, &Conf, &mut ConfigSection) + 'static
) -> Self
Set the function that will be called when the section is being written to the file.
#Arguments
callback
- The callback for the section write operation.
Examples
use weechat::Weechat; use weechat::config::ConfigSectionSettings; let server_section_options = ConfigSectionSettings::new("server") .set_write_callback(|weechat, config, section| { Weechat::print("Writing section"); });
pub fn set_write_default_callback(
self,
callback: impl FnMut(&Weechat, &Conf, &mut ConfigSection) + 'static
) -> Self
[src]
self,
callback: impl FnMut(&Weechat, &Conf, &mut ConfigSection) + 'static
) -> Self
Set the function that will be called when default values will need to be written to to the file.
#Arguments
callback
- The callback for the section write default operation.
Trait Implementations
impl Default for ConfigSectionSettings
[src]
fn default() -> ConfigSectionSettings
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ConfigSectionSettings
impl !Send for ConfigSectionSettings
impl !Sync for ConfigSectionSettings
impl Unpin for ConfigSectionSettings
impl !UnwindSafe for ConfigSectionSettings
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>,