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
//! This module provides encoding of typed messages
//!
//! Without the `std` feature enabled, you'll only be able to encode to a [`core::fmt::Write`] source (e.g. a [`String`])
//!
//! If you enable the `std` feature, then you'll also be able to encode to a [`std::io::Write`] source (e.g. a [`Vec<u8>`] or a [`std::net::TcpStream`])
//!
//! # Provided traits:
//!
//! | Trait | Description | Feature | Example |
//! | --- | --- | --- | --- |
//! | [`Format`] | Format this message to the [`core::fmt::Write`] | -- | `ping("asdf").format(&mut buf)` |
//! | [`Formattable`] | Using [`core::fmt::Write`] format this message | -- | `buf.format_msg(ping("asdf"))` |
//! | [`Encode`] | Encode this message to the [`std::io::Write`] | `std` | `ping("asdf").encode(&mut buf)` |
//! | [`Encodable`] | Using [`std::io::Write`] type encode this message | `std` | `buf.encode_msg(ping("asdf"))` |
//!
//! Using one of the [functions](#functions) creates one of the [types](#structs).
//!
//! These don't allocate directly and when using with `&'static str` can be stored in `static`/`const` contexts.
//!
//! # Example
//!
//! ```rust
//! use twitch_message::encode::{privmsg, Privmsg, Format, Formattable};
//!
//! const KAPPA: Privmsg<'static> = privmsg("museun", "Kappa");
//!
//! let vohiyo = privmsg("museun", "VoHiYo");
//!
//! let mut buf = String::new();
//! KAPPA.format(&mut buf)?;
//! buf.format_msg(vohiyo)?;
//!
//! assert_eq!(buf, "PRIVMSG #museun :Kappa\r\nPRIVMSG #museun :VoHiYo\r\n");
//! # Ok::<(),Box<dyn std::error::Error>>(())
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub