#[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.
Trait Implementations§
Source§impl Clone for CidCapability
impl Clone for CidCapability
Source§fn clone(&self) -> CidCapability
fn clone(&self) -> CidCapability
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 CidCapability
impl Debug for CidCapability
Source§impl Default for CidCapability
impl Default for CidCapability
Source§fn default() -> CidCapability
fn default() -> CidCapability
Source§impl<'de> Deserialize<'de> for CidCapability
impl<'de> Deserialize<'de> for CidCapability
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CidCapability
impl PartialEq for CidCapability
Source§fn eq(&self, other: &CidCapability) -> bool
fn eq(&self, other: &CidCapability) -> bool
self and other values to be equal, and is used by ==.