#[non_exhaustive]pub struct SpaceMetadataPatch {
pub name: Option<String>,
pub description: Option<Clearable<String>>,
pub icon_blob_id: Option<Clearable<Id>>,
pub is_public: Option<bool>,
pub is_publicly_previewable: Option<bool>,
pub extra: Map<String, Value>,
}Expand description
A typed view of the five top-level metadata fields that
Space/set update can mutate (draft-atwood-jmap-chat-00
§Space/set, fields name, description, iconBlobId, isPublic,
isPubliclyPreviewable).
Server-side handlers parse the wire patch’s metadata-key subset
into this struct (stripping structural mutation keys like
addRoles first), then hand it to
ChatBackend::apply_space_metadata_patch. Each field is Option<_>;
None means the field is absent from the wire patch and the
corresponding Space property is left unchanged. Nullable target
fields (description,
icon_blob_id) use
Option<Clearable<T>> so a wire null clears the value while
absence leaves it untouched.
is_public and is_publicly_previewable are Option<bool>
(not Option<Clearable<bool>>) because the corresponding Space
fields are non-nullable booleans: a wire null on either is
invalid and the handler rejects it before this struct is
constructed.
Replaces the earlier serde_json::Map<String, serde_json::Value>
trait surface (bd:JMAP-x2gd.39) so the public API no longer leaks
the upstream serde_json type into every ChatBackend impl.
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.name: Option<String>The name property (draft-atwood-jmap-chat-00 §Space/set
— top-level metadata).
Space.name is non-nullable (String), so the wire patch
value MUST be a string when present; null is invalid and
is rejected at the handler boundary.
description: Option<Clearable<String>>The description property (draft-atwood-jmap-chat-00 §Space/set
— top-level metadata).
null clears the description; absent leaves it unchanged.
icon_blob_id: Option<Clearable<Id>>The iconBlobId property (draft-atwood-jmap-chat-00 §Space/set
— top-level metadata).
null clears the icon; absent leaves it unchanged.
is_public: Option<bool>The isPublic property (draft-atwood-jmap-chat-00 §Space/set
— top-level metadata).
Non-nullable target field; wire null is invalid.
is_publicly_previewable: Option<bool>The isPubliclyPreviewable property
(draft-atwood-jmap-chat-00 §Space/set — top-level metadata).
Non-nullable target field; wire null is invalid.
extra: Map<String, Value>Catch-all for vendor / site / private extension fields not covered by the typed fields above. Preserves unknown fields across deserialize/serialize round-trip per workspace extras-preservation policy (see workspace AGENTS.md).
Implementations§
Trait Implementations§
Source§impl Clone for SpaceMetadataPatch
impl Clone for SpaceMetadataPatch
Source§fn clone(&self) -> SpaceMetadataPatch
fn clone(&self) -> SpaceMetadataPatch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more