[−][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.14", features = ["async"] }
For twitch types:
For the 'irc' types underneath it all:
For an event loop:
For just decoding messages:
For just encoding messages:
Modules
| channel | asyncSimple async/sync channels used in various parts of this crate. |
| commands | Provides |
| connector | asyncThis 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 std::borrow::Cow like type used in this crate. |
| messages | Twitch messages that can be parsed from |
| rate_limit | A simple leaky-bucket style token-based rate limiter |
| runner | A set of runners for managing a |
| test | Helpful testing utilities |
| twitch | Common Twitch types |
| writer | asyncA set of writers |
Structs
| AsyncDecoder | asyncA decoder over futures_lite::AsyncRead that produces IrcMessages |
| AsyncEncoder | asyncAn asynchronous encoder. |
| AsyncRunner | asyncAn asynchronous runner |
| Decoder | A decoder over std::io::Read that produces IrcMessages |
| Encoder | A synchronous encoder |
| IrcMessage | A raw irc message |
| 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 |
| IntoIrcMessage | A trait to convert a |
| IntoOwned | Converts a borrowed type into an owned type. e.g. |
| PrivmsgExt | Extensions to the |
| Validator | This trait is provided as an easy way of defining your own custom events. |
Type Definitions
| BoxedFuture | A boxed |
| Writer | asyncAn AsyncWriter over an MpscWriter |