# Enum json::Patch

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

`zaun_community_protocol::json::Patch` · Enum

```rust
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")]`.

## Variants

### `Keep`

The field was absent: keep the current value.

### `Clear`

The field was `null`: clear it.

### `Set(T)`

The field was present: set it.

## Methods

### `is_keep`

```rust
pub const fn is_keep(&self) -> bool
```

Whether the field was absent.

## Trait implementations

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

[Full rustdoc page](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/json/enum.Patch.html)
