Struct hexchat_unsafe_plugin::ValidContext
source · [−]pub struct ValidContext<'a, 'ph: 'a> { /* private fields */ }Expand description
A PluginHandle operating on a valid context.
This mechanism attempts to reduce the likelihood of segfaults in hexchat code.
See also PluginHandle::ensure_valid_context.
Implementations
sourceimpl<'a, 'ph: 'a> ValidContext<'a, 'ph>
impl<'a, 'ph: 'a> ValidContext<'a, 'ph>
sourcepub fn find_context(
&mut self,
servname: Option<&str>,
channel: Option<&str>
) -> Option<Context<'ph>>
pub fn find_context(
&mut self,
servname: Option<&str>,
channel: Option<&str>
) -> Option<Context<'ph>>
Finds an open context for the given servname and channel.
sourcepub fn nickcmp(&mut self, nick1: &str, nick2: &str) -> Ordering
pub fn nickcmp(&mut self, nick1: &str, nick2: &str) -> Ordering
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
)
pub fn emit_print<'b, I: IntoIterator<Item = &'b str>>(
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
pub fn get_context(&mut self) -> Context<'ph>
sourcepub fn set_context(&mut self, ctx: &Context<'ph>) -> bool
pub fn set_context(&mut self, ctx: &Context<'ph>) -> bool
Sets the current context.
Returns true if the context is valid, false otherwise.
sourcepub fn hook_command<F>(
&mut self,
cmd: &str,
pri: i32,
help: Option<&str>,
cb: F
) -> HookHandle<'ph> where
F: Fn(&mut PluginHandle<'ph>, Word<'_>, WordEol<'_>) -> Eat + 'ph + RefUnwindSafe,
pub fn hook_command<F>(
&mut self,
cmd: &str,
pri: i32,
help: Option<&str>,
cb: F
) -> HookHandle<'ph> where
F: Fn(&mut PluginHandle<'ph>, Word<'_>, WordEol<'_>) -> Eat + 'ph + RefUnwindSafe,
Sets a command hook
sourcepub fn hook_server<F>(&mut self, cmd: &str, pri: i32, cb: F) -> HookHandle<'ph> where
F: Fn(&mut PluginHandle<'ph>, Word<'_>, WordEol<'_>) -> Eat + 'ph + RefUnwindSafe,
pub fn hook_server<F>(&mut self, cmd: &str, pri: i32, cb: F) -> HookHandle<'ph> where
F: Fn(&mut PluginHandle<'ph>, Word<'_>, WordEol<'_>) -> Eat + 'ph + RefUnwindSafe,
Sets a server hook
sourcepub fn hook_server_attrs<F>(
&mut self,
cmd: &str,
pri: i32,
cb: F
) -> HookHandle<'ph> where
F: Fn(&mut PluginHandle<'ph>, Word<'_>, WordEol<'_>, EventAttrs<'_>) -> Eat + 'ph + RefUnwindSafe,
pub fn hook_server_attrs<F>(
&mut self,
cmd: &str,
pri: i32,
cb: F
) -> HookHandle<'ph> where
F: Fn(&mut PluginHandle<'ph>, Word<'_>, WordEol<'_>, EventAttrs<'_>) -> Eat + 'ph + RefUnwindSafe,
Sets a server hook with attributes
sourcepub fn hook_print<F>(&mut self, name: &str, pri: i32, cb: F) -> HookHandle<'ph> where
F: Fn(&mut PluginHandle<'ph>, Word<'_>) -> Eat + 'ph + RefUnwindSafe,
pub fn hook_print<F>(&mut self, name: &str, pri: i32, cb: F) -> HookHandle<'ph> where
F: Fn(&mut PluginHandle<'ph>, Word<'_>) -> Eat + 'ph + RefUnwindSafe,
Sets a print hook
sourcepub fn hook_print_attrs<F>(
&mut self,
name: &str,
pri: i32,
cb: F
) -> HookHandle<'ph> where
F: Fn(&mut PluginHandle<'ph>, Word<'_>, EventAttrs<'_>) -> Eat + 'ph + RefUnwindSafe,
pub fn hook_print_attrs<F>(
&mut self,
name: &str,
pri: i32,
cb: F
) -> HookHandle<'ph> where
F: Fn(&mut PluginHandle<'ph>, Word<'_>, EventAttrs<'_>) -> Eat + 'ph + RefUnwindSafe,
Sets a print hook with attributes
sourcepub fn hook_timer<F>(&mut self, timeout: i32, cb: F) -> HookHandle<'ph> where
F: Fn(&mut PluginHandle<'ph>) -> bool + 'ph + RefUnwindSafe,
pub fn hook_timer<F>(&mut self, timeout: i32, cb: F) -> HookHandle<'ph> where
F: Fn(&mut PluginHandle<'ph>) -> bool + 'ph + RefUnwindSafe,
Sets a timer hook
pub fn get_info<'b>(&'b mut self, id: InfoId<'_>) -> Option<&'b str>
Auto Trait Implementations
impl<'a, 'ph> RefUnwindSafe for ValidContext<'a, 'ph>
impl<'a, 'ph> !Send for ValidContext<'a, 'ph>
impl<'a, 'ph> !Sync for ValidContext<'a, 'ph>
impl<'a, 'ph> Unpin for ValidContext<'a, 'ph> where
'ph: 'a,
impl<'a, 'ph> !UnwindSafe for ValidContext<'a, 'ph>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more