[][src]Crate hexchat

A safe API for creating HexChat plugins.

To get started, create a struct representing your plugin, and implement Plugin for it. Then, call plugin! on the struct.

All plugins should be built as cdylibs, or if for some reason you have no other choice, dylibs. Do not attempt to define a main() symbol; Plugin::new is your plugin's 'entry point'. For that matter, do not attempt to define the HexChat C docs' described extern fns - this is taken care of for you by the plugin! macro.

If window manipulation is desired, the window feature should be enabled.

Static variables holding heap resources are discouraged and will cause memory leaks. This crate provides a safe_static! macro for this purpose. Please note that any thread that you create that accesses a safe static must be killed in your plugin's Drop implementation, and it's undefined not to. You should kill them anyway even if you don't use this, because they'll be a memory leak too otherwise.

Modules

reply

Server responses for use with Context::add_server_response_listener.

server_event

Server events for use with Context::add_server_event_listener.

Macros

plugin

This macro will set up your plugin's actual callability from HexChat.

safe_static

A macro for creating SafeLazys and SafeUninits.

Structs

ChannelFlags

Various boolean flags about a ChannelInfo.

ChannelInfo

A full set of information about an IRC channel.

ChannelRef

A channel reference, for identification purposes only. Use into_info to request channel information.

Command

A handle to a registered command.

Context

The main object for working with HexChat. Passed to you via callbacks.

DccTransferInfo

A full set of information about a DCC transfer.

FakePlugin

A handle to a fake plugin entry in the plugin list.

IgnoreEntry

An entry in HexChat's ignore list.

IgnoreType

All the message types that can be present in an IgnoreEntry.

IrcIdent

An IRC identifier. Mainly used for its Ord implementation.

IrcIdentRef

An IRC identifier. Mainly used for its Ord implementation.

NotifyEntry

An entry in HexChat's notify list.

PrintEvent

Represents a 'print event' in HexChat, i.e. an invocation of one of a hundred and fifty different format strings corresponding to any possible action.

PrintEventListener

A handle to a registered print event listener.

Priority

The priority of an event listener or command.

RawServerEventListener

A handle to a registered raw server event listener.

ReplyListener

A handle to a registered reply listener.

SafeLazy

A lazily-evaluated resource that is safe to use in a HexChat plugin.

SafeUninit

An initially uninitialized resource that is safe to use in a HexChat plugin.

ServerEventListener

A handle to a registered server event listener.

TimerTask

A handle to a registered timer task.

UserInfo

Information about another user.

UserMask

Represents a user mask, typically formatted like nick!user@address, where any of the components can be replaced with a *.

UserString

Represents a userstring, typically formatted like nick!user@address.

WindowEvent

An event corresponding to a window action.

WindowEventListener

A handle to a registered window event listener.

Enums

ChannelType

An enumeration of different channel types.

DccTransferStatus

The various statuses that can describe a DccTransferInfo.

DccTransferType

An enumeration of all possible DCC transfer types.

EatMode

Represents who to hide an event or command from.

GlobalPreferenceValue

Possible values from Context::get_global_pref.

Traits

Plugin

This trait must be implemented on a type before the type is passed to plugin!.