Expose MODSEQ attribute in FETCH responses
If the QRESYNC (RFC 7162) extension is being used, a FETCH response to a STORE or UID STORE command with the UNCHANGEDSINCE query attribute will return the mod sequence ID of the performed operation. This information is crucial for building efficient caching clients.
This commit is contained in:
parent
db29117463
commit
4ea652e3f7
1 changed files with 11 additions and 0 deletions
|
|
@ -115,6 +115,17 @@ impl<'a> Fetch<'a> {
|
||||||
&self.flags[..]
|
&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<u64> {
|
||||||
|
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]`,
|
/// 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`.
|
/// or `RFC822.HEADER` was included in the `query` argument to `FETCH`.
|
||||||
pub fn header(&self) -> Option<&[u8]> {
|
pub fn header(&self) -> Option<&[u8]> {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue