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
use fmt;
/// An NNTP command
///
/// All `NntpCommands` must implement [`fmt::Display`] such that
/// [`fmt`](fmt::Display::fmt) returns the string that should be sent over the wire.
///
/// # Example: Implementing LISTGROUP
/// ```
/// use std::fmt;
/// use brokaw::types::command::NntpCommand;
///
/// #[derive(Clone, Debug)]
/// pub struct ListGroup {
/// group: Option<String>,
/// range: Option<(u32, u32)>,
/// }
///
/// impl fmt::Display for ListGroup {
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
/// write!(f, "LISTGROUP")?;
///
/// if let Some(group) = &self.group {
/// write!(f, " {}", &group)?;
/// }
///
/// if let Some((low, high)) = &self.range {
/// write!(f, " {}-{}", low, high)?;
/// }
/// Ok(())
/// }
/// }
///
/// impl NntpCommand for ListGroup {}
///
/// let cmd = ListGroup {
/// group: Some("misc.test".to_string()),
/// range: Some((10, 20))
/// };
///
/// assert_eq!(cmd.to_string(), "LISTGROUP misc.test 10-20")
/// ```
/// Commands specified in [RFC 3977](https://tools.ietf.org/html/rfc3977#appendix-B)
pub use *;
/// Commands specified in [RFC 2980](https://tools.ietf.org/html/rfc2980)
pub use *;
/// AUTHINFO commands specified in [RFC 4643](https://tools.ietf.org/html/rfc4643)
pub use *;
pub use *;