Skip to main content

build_replace_ops

Function build_replace_ops 

Source
fn build_replace_ops(
    old_keys: impl IntoIterator<Item = Vec<u8>>,
    new_kvs: Vec<(Vec<u8>, Vec<u8>)>,
) -> Vec<TxnOp>
Expand description

Builds txn ops that replace the old_keys with the new_kvs.

Only deletes the old keys absent from new_kvs: etcd rejects a txn that writes the same key more than once (“duplicate key given in txn request”).