[][src]Struct hexchat_plugin::EnsureValidContext

pub struct EnsureValidContext<'a> { /* fields omitted */ }

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]

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]

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]

pub fn emit_print_attrs<'b, I: IntoIterator<Item = &'b str>>(
    self,
    attrs: EventAttrs,
    event: &str,
    args: I
) -> bool
[src]

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]

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]

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]

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]

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]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]