Introduce feature-gated `serde` dependency
* derive `serde::{Deserialize, Serialize}` for `Capability` and `AuthMechanism`.
This commit is contained in:
parent
7cac2a2903
commit
21138c353b
|
@ -10,6 +10,13 @@ edition = "2018"
|
|||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[features]
|
||||
default = []
|
||||
serdex = ["serde"]
|
||||
|
||||
[dependencies]
|
||||
nom = "6"
|
||||
abnf-core = "0.4.0"
|
||||
|
||||
# Optional
|
||||
serde = { version = "1.0", features = ["derive"], optional = true }
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
use crate::utils::escape_quoted;
|
||||
#[cfg(feature = "serdex")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::io::Write;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
|
@ -321,6 +323,7 @@ impl EhloOkResp {
|
|||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
|
||||
#[cfg_attr(feature = "serdex", derive(Serialize, Deserialize))]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Capability {
|
||||
// Send as mail [RFC821]
|
||||
|
@ -502,6 +505,7 @@ impl Capability {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "serdex", derive(Serialize, Deserialize))]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum AuthMechanism {
|
||||
Plain,
|
||||
|
|
Loading…
Reference in New Issue