#[non_exhaustive]pub struct CidCapability {
pub extra: Map<String, Value>,
}Expand description
Value object of the urn:ietf:params:jmap:cid capability
(draft-atwood-jmap-cid-00 §3).
The draft currently specifies an empty value object: when a
server advertises CID, the value of the
JMAP_CID_URI key in both the session-level capabilities
object and per-account accountCapabilities is {}. The
#[non_exhaustive] attribute keeps the door open for the draft
to add capability-level fields (e.g. an enumerated digest
algorithm set when CID generalises beyond SHA-256) without a
breaking change to consumers that destructure the struct.
The extra field is the workspace
extras-preservation surface (workspace AGENTS.md
“extras-preservation policy”): unknown vendor / site / future
IETF fields on the wire JSON survive deserialize and serialize
untouched.
§Example
use jmap_cid_types::CidCapability;
// Empty value object per the current draft revision.
let cap: CidCapability = serde_json::from_str("{}")?;
assert!(cap.extra.is_empty());
// Vendor extension survives round-trip.
let cap: CidCapability = serde_json::from_str(
r#"{"acmeCorpFastDigest": true}"#,
)?;
assert_eq!(
cap.extra.get("acmeCorpFastDigest"),
Some(&serde_json::Value::Bool(true)),
);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.extra: Map<String, Value>Catch-all for vendor / site / future-IETF fields not covered by the typed fields above. Preserves unknown fields across deserialize/serialize round-trip per workspace policy.