pub enum WriteOp {
Replace,
Append,
}Expand description
What a write does to the attribute it names (§10.6.4.3.1’s Change enumeration).
The distinction exists because a list may be larger than one message, so §10.6.4.3.1 lets
a client send it as a series of blocks: one that replaces the list, then one per item. The
two are told apart only by whether the path carries ListIndex, which is why this has
to reach the cluster — the data alone cannot say which was meant.
For an attribute that is not a list there is only WriteOp::Replace, and it means what
a write has always meant.
Variants§
Replace
ListIndex omitted — §10.6.4.3.1’s REPLACE.
“Path SHALL refer to a list with ListIndex omitted and Data SHALL contain new values that will replace the existing contents of the list.” An empty array therefore clears the list, which is how the item-by-item encoding starts.
Append
ListIndex present and null — §10.6.4.3.1’s ADD.
“Path SHALL refer to a list with ListIndex containing a value of null and Data containing the new value of the list item that will be added to the list.” The item is appended; §8.7.3.3 requires the blocks be “processed in the order conveyed”, so the list ends up in the order the client sent.