Closed richarddd closed 1 year ago
Between 0.1.7 and 0.3.1 I have found a lot of soundness problems with the library which I had to remove.
Currently there is no way to get a mutable reference to ClassDef object. It used to be possible because we allowed you to take mutable references to the classdef from any class instance. This could result in aliasing mutable references which is unsound.
SelfMethod
is somewhat of a hack to make references to classes work again after #167
What you are doing with RefCells is currently the best way to do that.
I am working on redesigning the class interface in the class_redesign
branch to make this less verbose. It will internally use a RefCell like structure to allow mutable references.
You might want to wait on rewriting using the newer version cause the library is currently in a bit of an awkward place cause of all the functionality that had to be scrapped due to unsoundness.
Hi,
I'm trying to migrate my project from 0.1.7 to 0.3.1.
Since
Func::from(Method(...)
no longer accepting self functions with mutable references what can i use instead? We haveSelfMethod::from()
but that requires reference to be none mutable. The only example i see in tests is to use another implementation for methods that mutates like:...and then define the props like this:
Is there another (less verbose) way?