diff --git a/src/types/fetch.rs b/src/types/fetch.rs index 417da00..c64e71a 100644 --- a/src/types/fetch.rs +++ b/src/types/fetch.rs @@ -115,6 +115,17 @@ impl<'a> Fetch<'a> { &self.flags[..] } + /// Contains the mod sequence of the performed operation if in response to a `STORE` or + /// `UID STORE` with `UNCHANGEDSINCE` in the query arguments. + /// `UNCHANGEDSINCE` and the inclusion of the mod sequence in the response are part of the + /// [QRESYNC](https://tools.ietf.org/html/rfc7162#section-3.1.3) extension. + pub fn mod_seq(&self) -> Option { + self.fetch.iter().find_map(|av| match av { + AttributeValue::ModSeq(mod_seq) => Some(*mod_seq), + _ => None, + }) + } + /// The bytes that make up the header of this message, if `BODY[HEADER]`, `BODY.PEEK[HEADER]`, /// or `RFC822.HEADER` was included in the `query` argument to `FETCH`. pub fn header(&self) -> Option<&[u8]> {