1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#![warn(
missing_docs,
missing_debug_implementations,
missing_copy_implementations,
trivial_casts,
trivial_numeric_casts,
unreachable_pub,
unsafe_code,
unstable_features,
unused_import_braces,
unused_qualifications
)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#[cfg(all(doctest, feature = "async", feature = "tokio_native_tls"))]
doc_comment::doctest!("../README.md");
static_assertions::assert_cfg!(
not(all(
feature = "tokio_native_tls",
feature = "tokio_rustls",
)),
"only a single TLS library can be used."
);
#[macro_use]
#[doc(hidden)]
pub mod macros;
cfg_async! {
mod runner;
pub use runner::{
writer::{MpscWriter, Writer},
dispatcher::Dispatcher,
stream::EventStream,
runner::Runner,
control::Control,
status::Status
};
}
cfg_async! {
pub mod events;
}
cfg_async! {
mod register;
#[doc(inline)]
pub use register::register;
}
cfg_async! {
mod connect;
#[doc(inline)]
pub use connect::*;
}
pub mod decode;
#[doc(inline)]
pub use decode::{decode, decode_one};
pub mod encode;
#[doc(inline)]
pub use encode::Encoder;
pub mod twitch;
#[doc(inline)]
pub use twitch::*;
pub mod messages;
pub mod sync;
mod parse;
pub use parse::Parse;
mod as_owned;
#[doc(inline)]
pub use as_owned::AsOwned;
mod error;
#[doc(inline)]
pub use error::Error;
pub const TWITCH_IRC_ADDRESS: &str = "irc.chat.twitch.tv:6667";
pub const TWITCH_IRC_ADDRESS_TLS: &str = "irc.chat.twitch.tv:6697";
pub const TWITCH_WS_ADDRESS: &str = "ws://irc-ws.chat.twitch.tv:80";
pub const TWITCH_WS_ADDRESS_TLS: &str = "wss://irc-ws.chat.twitch.tv:443";
pub const ANONYMOUS_LOGIN: (&str, &str) = (JUSTINFAN1234, JUSTINFAN1234);
pub(crate) const JUSTINFAN1234: &str = "justinfan1234";
fn simple_user_config(name: &str, token: &str) -> Result<UserConfig, UserConfigError> {
UserConfig::builder()
.name(name)
.token(token)
.capabilities(&[
Capability::Membership,
Capability::Tags,
Capability::Commands,
])
.build()
}
cfg_async! {
#[doc(inline)]
pub mod rate_limit;
#[doc(inline)]
pub use rate_limit::RateLimit;
}