sigp / enr

Ethereum Node Record
MIT License
61 stars 29 forks source link

Unify update recovery logic under an update guard #57

Closed divagant-martian closed 10 months ago

divagant-martian commented 1 year ago
divagant-martian commented 10 months ago

The API I wanted to achieve needs features rust does not have yet. In an ideal world, I'd like to be able to do

let (prev_val1, prev_val2, prev_val3) = enr
    .update_guard()
    .insert(key1, value1)
    .insert(key2, value1)
    .remove(key3)
    .finish()?;

for arbitrary number of values

this intermediate state I achieved it not good enough to justify the complexity.

I'm thus closing