Skip to content

Enum json::Patch

zaun_community_protocol::json::Patch · Enum

pub enum Patch<T> { … }

A field that distinguishes “absent” from “null” in update commands (channel.update with "topic": null clears the topic; no topic leaves it).

Use with #[serde(default, skip_serializing_if = "Patch::is_keep")].

The field was absent: keep the current value.

The field was null: clear it.

The field was present: set it.

pub const fn is_keep(&self) -> bool

Whether the field was absent.

Clone, Debug, Default, Deserialize<'de>, Eq, PartialEq, Serialize, StructuralPartialEq

Full rustdoc page