Skip to main content

SpaceMetadataPatch

Struct SpaceMetadataPatch 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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§

Source§

impl SpaceMetadataPatch

Source

pub fn is_empty(&self) -> bool

Returns true if the patch carries no metadata mutations and no extras. Empty patches are valid no-ops at the wire level.

Trait Implementations§

Source§

impl Clone for SpaceMetadataPatch

Source§

fn clone(&self) -> SpaceMetadataPatch

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SpaceMetadataPatch

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for SpaceMetadataPatch

Source§

fn default() -> SpaceMetadataPatch

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for SpaceMetadataPatch

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<SpaceMetadataPatch, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for SpaceMetadataPatch

Source§

fn eq(&self, other: &SpaceMetadataPatch) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for SpaceMetadataPatch

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SpaceMetadataPatch

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.