Struct hexchat_plugin::EnsureValidContext [−][src]
pub struct EnsureValidContext<'a> { /* fields omitted */ }
Expand description
A safety wrapper to ensure you’re working with a valid context.
This mechanism attempts to reduce the likelihood of segfaults.
Implementations
impl<'a> EnsureValidContext<'a>
[src]
impl<'a> EnsureValidContext<'a>
[src]pub fn find_context(
&mut self,
servname: Option<&str>,
channel: Option<&str>
) -> Option<Context>
[src]
pub fn find_context(
&mut self,
servname: Option<&str>,
channel: Option<&str>
) -> Option<Context>
[src]Finds an open context for the given servname and channel.
pub fn nickcmp(&mut self, nick1: &str, nick2: &str) -> Ordering
[src]
pub fn nickcmp(&mut self, nick1: &str, nick2: &str) -> Ordering
[src]Compares two nicks based on the server’s case mapping.
pub fn send_modes<'b, I: IntoIterator<Item = &'b str>>(
&mut self,
iter: I,
mpl: i32,
sign: char,
mode: char
)
[src]
&mut self,
iter: I,
mpl: i32,
sign: char,
mode: char
)
pub fn emit_print<'b, I: IntoIterator<Item = &'b str>>(
self,
event: &str,
args: I
) -> bool
[src]
self,
event: &str,
args: I
) -> bool
pub fn emit_print_attrs<'b, I: IntoIterator<Item = &'b str>>(
self,
attrs: EventAttrs<'_>,
event: &str,
args: I
) -> bool
[src]
self,
attrs: EventAttrs<'_>,
event: &str,
args: I
) -> bool
pub fn get_context(&mut self) -> Context
[src]
pub fn set_context(&mut self, ctx: &Context) -> bool
[src]
pub fn set_context(&mut self, ctx: &Context) -> bool
[src]Sets the current context.
Returns true
if the context is valid, false
otherwise.
pub fn hook_command<F>(
&mut self,
cmd: &str,
cb: F,
pri: i32,
help: Option<&str>
) -> CommandHookHandle where
F: Fn(&mut PluginHandle, Word<'_>, WordEol<'_>) -> Eat + 'static + RefUnwindSafe,
[src]
pub fn hook_command<F>(
&mut self,
cmd: &str,
cb: F,
pri: i32,
help: Option<&str>
) -> CommandHookHandle where
F: Fn(&mut PluginHandle, Word<'_>, WordEol<'_>) -> Eat + 'static + RefUnwindSafe,
[src]Sets a command hook
pub fn hook_server<F>(&mut self, cmd: &str, cb: F, pri: i32) -> ServerHookHandle where
F: Fn(&mut PluginHandle, Word<'_>, WordEol<'_>) -> Eat + 'static + RefUnwindSafe,
[src]
pub fn hook_server<F>(&mut self, cmd: &str, cb: F, pri: i32) -> ServerHookHandle where
F: Fn(&mut PluginHandle, Word<'_>, WordEol<'_>) -> Eat + 'static + RefUnwindSafe,
[src]Sets a server hook
pub fn hook_print<F>(&mut self, name: &str, cb: F, pri: i32) -> PrintHookHandle where
F: Fn(&mut PluginHandle, Word<'_>) -> Eat + 'static + RefUnwindSafe,
[src]
pub fn hook_print<F>(&mut self, name: &str, cb: F, pri: i32) -> PrintHookHandle where
F: Fn(&mut PluginHandle, Word<'_>) -> Eat + 'static + RefUnwindSafe,
[src]Sets a print hook
pub fn hook_timer<F>(&mut self, timeout: i32, cb: F) -> TimerHookHandle where
F: Fn(&mut PluginHandle) -> bool + 'static + RefUnwindSafe,
[src]
pub fn hook_timer<F>(&mut self, timeout: i32, cb: F) -> TimerHookHandle where
F: Fn(&mut PluginHandle) -> bool + 'static + RefUnwindSafe,
[src]Sets a timer hook