[−][src]Struct hexchat_plugin::EnsureValidContext
A safety wrapper to ensure you're working with a valid context.
This mechanism attempts to reduce the likelihood of segfaults.
Methods
impl<'a> EnsureValidContext<'a>
[src]
pub fn find_context(
&mut self,
servname: Option<&str>,
channel: Option<&str>
) -> Option<Context>
[src]
&mut self,
servname: Option<&str>,
channel: Option<&str>
) -> Option<Context>
Finds an open context for the given servname and channel.
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 command(self, cmd: &str)
[src]
Executes a command.
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]
Sets the current context.
Returns true
if the context is valid, false
otherwise.
pub fn print(&mut self, s: &str)
[src]
Prints to the hexchat buffer.
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]
&mut self,
cmd: &str,
cb: F,
pri: i32,
help: Option<&str>
) -> CommandHookHandle where
F: Fn(&mut PluginHandle, Word, WordEol) -> Eat + 'static + RefUnwindSafe,
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]
F: Fn(&mut PluginHandle, Word, WordEol) -> Eat + 'static + RefUnwindSafe,
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]
F: Fn(&mut PluginHandle, Word) -> Eat + 'static + RefUnwindSafe,
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]
F: Fn(&mut PluginHandle) -> bool + 'static + RefUnwindSafe,
Sets a timer hook
pub fn get_info(&mut self, id: &InfoId) -> Option<String>
[src]
Auto Trait Implementations
impl<'a> !Send for EnsureValidContext<'a>
impl<'a> !Sync for EnsureValidContext<'a>
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,