async_pop/response/capability.rs
1use bytes::Bytes;
2
3use super::types::{message::Text, number::Duration};
4
5#[derive(Eq, PartialEq, PartialOrd, Ord, Debug, Hash, Clone, Default)]
6pub enum Expiration {
7 #[default]
8 Never,
9 Time(Duration),
10}
11
12#[derive(Eq, PartialEq, PartialOrd, Ord, Debug, Hash, Clone)]
13pub enum Capability {
14 /// Whether the TOP command is supported.
15 Top,
16 /// Whether the USER and PASS commands (login) are supported.
17 User,
18 /// Whether the use of a SASL based login is supported and if so what kinds. See https://www.rfc-editor.org/rfc/rfc1734
19 Sasl(Vec<Bytes>),
20 /// Whether the server uses extends response codes. See https://www.rfc-editor.org/rfc/rfc2449#section-8
21 RespCodes,
22 /// Whether there is a delay between each login and how long it is.
23 LoginDelay(Duration),
24 /// Whether the server supports pipelining. See https://www.rfc-editor.org/rfc/rfc2197
25 Pipelining,
26 /// The amount of time the server will store messsages for.
27 Expire(Expiration),
28 /// Whether the UIDL command is supported.
29 Uidl,
30 /// The type of authentication method the server prefers/uses.
31 Implementation(Text),
32 Stls,
33 Other(Text),
34}
35
36pub type Capabilities = Vec<Capability>;