#[non_exhaustive]pub enum ComparatorProperty {
ReceivedAt,
Size,
From,
To,
Subject,
SentAt,
HasKeyword,
AllInThreadHaveKeyword,
SomeInThreadHaveKeyword,
Other(String),
}Expand description
The property to sort by in an EmailComparator (RFC 8621 §4.4.2).
When the variant is HasKeyword,
AllInThreadHaveKeyword, or
SomeInThreadHaveKeyword,
the keyword field on EmailComparator MUST also be set
(RFC 8621 §4.4.2).
Unknown property names from the server are preserved in
Other so they round-trip correctly.
§Excluded from extras preservation
This enum is out of scope for the workspace extras-preservation
policy: it is a control enum that backends must dispatch on to
determine the sort order, so a generic catch-all variant would be
meaningless for query execution. The Other(String) variant that
ComparatorProperty does carry exists only to preserve unknown
property names for client-side round-tripping; servers cannot
meaningfully sort by an unrecognised property without a registered
extension.
More broadly, filter / comparator algebra is excluded because unrecognised clauses are a query-correctness hazard: silently dropping or round-tripping a clause the server does not understand can return the wrong set of records to the client without any error signal.
§What to do instead
IETF-track path. Vendors who need both capability-level declaration
and filterability for custom fields should use
draft-ietf-jmap-metadata (capability URI
urn:ietf:params:jmap:metadata), which defines a filterable
Metadata / Annotation companion object. Implemented in jmap-metadata-types,
jmap-metadata-server, and jmap-metadata-client (bd JMAP-06zp).
Pre-IETF escape. Vendors who cannot wait for the metadata draft can
either escape to serde_json::Value or fork the per-crate
FilterCondition / ComparatorProperty types. See
crate-jmap-calendars-types/PLAN.md for the hybrid sloppy-value
pattern.
Cross-reference: bd JMAP-lbdy “Decision: filter algebra excluded”.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ReceivedAt
Sort by receivedAt.
Size
Sort by message size in octets.
From
Sort by the text of the From header field.
To
Sort by the text of the To header field.
Subject
Sort by the decoded Subject.
SentAt
Sort by sentAt.
HasKeyword
Sort by whether Emails in the Thread have the given keyword.
AllInThreadHaveKeyword
Sort by whether all Emails in the Thread have the given keyword.
SomeInThreadHaveKeyword
Sort by whether some Emails in the Thread have the given keyword.
Other(String)
A server-extension property name not listed above.
Trait Implementations§
Source§impl Clone for ComparatorProperty
impl Clone for ComparatorProperty
Source§fn clone(&self) -> ComparatorProperty
fn clone(&self) -> ComparatorProperty
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ComparatorProperty
impl Debug for ComparatorProperty
Source§impl<'de> Deserialize<'de> for ComparatorProperty
impl<'de> Deserialize<'de> for ComparatorProperty
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Source§impl Display for ComparatorProperty
impl Display for ComparatorProperty
impl Eq for ComparatorProperty
Source§impl Hash for ComparatorProperty
impl Hash for ComparatorProperty
Source§impl PartialEq for ComparatorProperty
impl PartialEq for ComparatorProperty
Source§fn eq(&self, other: &ComparatorProperty) -> bool
fn eq(&self, other: &ComparatorProperty) -> bool
self and other values to be equal, and is used by ==.