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]

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<T: ToString>(&mut self, s: T)[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> RefUnwindSafe for EnsureValidContext<'a>

impl<'a> !Send for EnsureValidContext<'a>

impl<'a> !Sync for EnsureValidContext<'a>

impl<'a> Unpin for EnsureValidContext<'a>

impl<'a> !UnwindSafe for EnsureValidContext<'a>

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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

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

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.