Patch#
A field of an update record that tells "leave as is" apart from "clear". Every field of TaskUpdate, LinkUpdate, ResourceUpdate and AssignmentUpdate, except id, is a Patch.
Declaration#
Variants#
| Variant | Description |
|---|---|
Missing |
The field isn't touched. Default. |
Null |
Clears the field. An optional field becomes empty; a field with a default value goes back to that default. On a required field (such as a link's source or an assignment's resource), the operation is rejected with a validation InputError. |
Value(T) |
Sets the field to the given value. |
Which fields are optional, which have defaults and which are required is listed on each update record's page.
Methods#
Patch::is_missing#
Returns true for Patch::Missing, false for Null and Value.
Serde#
With the serde feature, Patch<T> implements Serialize and Deserialize when T does:
Value(v)serializes asv;MissingandNullboth serialize asnullnulldeserializes toNull, any other value toValue. Deserialization never producesMissing
Example#
use ;
Related#
SchedulingChanges- carries the update records whose fields are patches- Data Updates - shows update records and
Patchvalues together - Clear leveling - uses
Patchvalues to reset leveling fields