Re:Why asynchronous Rust doesn't work
by xondono on Sunday November 14, 2021 @05:12AM
(#29216369)
> But the callback could of course set a result type somewhere [..] then we could know if/when it is finished
That would be a Mutex<>, the author mentions it in the comments. This would solve the “writing at the same time issue”, but not the lifetimes, so you’d need another change.
Instead of trying the mess of implementing special closures, you could just make your db static.
That would be a Mutex<>, the author mentions it in the comments. This would solve the “writing at the same time issue”, but not the lifetimes, so you’d need another change.
Instead of trying the mess of implementing special closures, you could just make your db static.