clean msg flags, merge tpl entity in msg (#231)

* merge tpl entity into msg

* change envelope subject type to cow

* msg: fix save command when raw msg comes from stdin

* msg: clean flags
This commit is contained in:
Clément DOUIN
2021-10-23 00:17:24 +02:00
committed by GitHub
parent 45aac9fbec
commit d9272917f5
19 changed files with 228 additions and 264 deletions
+6 -1
View File
@@ -1,10 +1,15 @@
pub use imap::types::Flag;
use serde::ser::{Serialize, Serializer};
/// Serializable wrapper arround [`imap::types::Flag`].
/// Represents a serializable `imap::types::Flag`.
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct SerializableFlag<'a>(pub &'a Flag<'a>);
/// Implements the serialize trait for `imap::types::Flag`.
/// Remote serialization cannot be used because of the [#[non_exhaustive]] directive of
/// `imap::types::Flag`.
///
/// [#[non_exhaustive]]: https://github.com/serde-rs/serde/issues/1991
impl<'a> Serialize for SerializableFlag<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where