You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, with GCounter instead of Orswot as the inner CRDT, this is more awkward, since the GCounter::inc function takes an actor directly, and not a context. Feels like an inconsistency. Or maybe I just missed docs somewhere, since I'm still exploring CRDTs.
My code so far, which feels wrong:
typeA = &'static str;letmut m:Map<String,GCounter<A>,A> = Map::new();let add_ctx:AddCtx<A> = m.read_ctx().derive_add_ctx("Actor1");
m.apply(m.update("Kiiya",
add_ctx,
|previous:&GCounter<A>,add_ctx:AddCtx<A>| {// return type of this closure is a `Dot<A>`.
previous.inc(add_ctx.dot.actor)// This feels very wrong. I should be able to use the add_ctx directly here.}));
The text was updated successfully, but these errors were encountered:
It seems like the intended way to use the
Map::update
function is to use the context given in the closure, e.g.|set, c| set.add("erik", c)
:rust-crdt/examples/reset_remove.rs
Lines 18 to 22 in b405f77
However, with
GCounter
instead ofOrswot
as the inner CRDT, this is more awkward, since theGCounter::inc
function takes an actor directly, and not a context. Feels like an inconsistency. Or maybe I just missed docs somewhere, since I'm still exploring CRDTs.My code so far, which feels wrong:
The text was updated successfully, but these errors were encountered: