Currently, ResourceIndex::update_one() returns a Result<IndexUpdate<Id>>, which basically just includes a couple of hashsets for added and removed resources. This is simple so that it matches the return type of update_all().
However, we should consider enhancing update_one to provide more detailed events. This could make the Track API and Watch API more powerful compared to the Reactive API. The goal is to support finer-grained events, similar to what notify-rs offers, including not just add/remove events but also rename and modify events.
Also, we can consider returning enum from update_one (instead of struct), since only one path can be updated. But this is only possible if we have dedicated enum variants for modifications and renamings.
Currently,
ResourceIndex::update_one()
returns aResult<IndexUpdate<Id>>
, which basically just includes a couple of hashsets for added and removed resources. This is simple so that it matches the return type ofupdate_all()
.However, we should consider enhancing
update_one
to provide more detailed events. This could make the Track API and Watch API more powerful compared to the Reactive API. The goal is to support finer-grained events, similar to whatnotify-rs
offers, including not just add/remove events but also rename and modify events.For more context, see https://github.com/ARK-Builders/ark-core/pull/36#discussion_r1751927054