[][src]Crate twitchchat

This crate provides a way to interface with Twitch's chat (via IRC).

Along with the messages as Rust types, it provides methods for sending messages.


By default, this crate depends on zero external crates -- but it makes it rather limited in scope.

This allows parsing, and decoding/encoding to standard trait types (std::io::{Read, Write}).

To use the AsyncRunner (an async-event loop) and related helpers, you must able the async feature.

NOTE This is a breaking change from 0.12 which had the async stuff enabled by default.

twitchchat = { version = "0.13", features = ["async"] }

To use a specific TcpStream/TlStream refer to the runtime table below.


For twitch types:


For the 'irc' types underneath it all:


For an event loop:


For just decoding messages:


For just encoding messages:


Modules

channelasync

Simple async/sync channels used in various parts of this crate.

commands

Provides Encodable commands.

connectorasync

This module lets you choose which runtime you want to use.

decoder

Decoding utilities.

encoder

Encoding utilies

irc

IRC message parsing.

maybe_owned

This is a Cow like type used in this crate.

messages

Twitch messages that can be parsed from IrcMessage, or subscribed to from the Dispatcher

rate_limit

A simple leaky-bucket style token-based rate limiter

runner

A set of runners for managing a event loop

twitch

Common Twitch types

writerasync

A set of writers

Structs

AsyncDecoderasync

A decoder over futures::io::AsyncRead that produces IrcMessages

AsyncEncoderasync

An asynchronous encoder.

AsyncRunnerasync

An asynchronous runner

Decoder

A decoder over std::io::Read that produces IrcMessages

Encoder

A synchronous encoder

IrcMessage

A raw irc message @tags :prefix COMMAND args :data\r\n

UserConfig

User configuration for 'registering' with Twitch

Enums

DecodeError

An error produced by a Decoder.

MessageError

An invalid message was either provided, or could not be parsed

RunnerError

An error returned by a Runner

Status

Status produced by the loop

Constants

ANONYMOUS_LOGIN

An anonymous login.

TWITCH_IRC_ADDRESS

The Twitch IRC address for non-TLS connections

TWITCH_IRC_ADDRESS_TLS

The Twitch IRC address for TLS connections

TWITCH_TLS_DOMAIN

A TLS domain for Twitch

TWITCH_WS_ADDRESS

The Twitch WebSocket address for non-TLS connections

TWITCH_WS_ADDRESS_TLS

The Twitch WebSocket address for TLS connections

Traits

Encodable

A trait to allow writing messags to any std::io::Write implementation

FromIrcMessage

A trait to convert an IrcMessage into Self.

IntoIrcMessage

A trait to convert a Self into an IrcMessage

IntoOwned

Converts a borrowed type into an owned type. e.g. 'a to 'static

PrivmsgExt

Extensions to the Privmsg message type

Validator

This trait is provided as an easy way of defining your own custom events.

Type Definitions

BoxedFutureasync

A boxed Future that is Send + Sync

Writerasync

An AsyncWriter over an MpscWriter