Hmm… I'd say for IO-bound tasks/loading in a DBMS yes, async/await coroutines are the correct abstraction, since you're waiting to reschedule on external notice and normally don't want to spin-wait (or you could block…
It's "Tokio". Coroutines in Rust are a native language feature and their API is part of `std`, but the executors indeed come from community libraries. Tokio is one option, but as long as you don't contextually fork (for…
Ah, you're right, I missed it because it's callee-controlled in C++. (See Heap Allocation and Promise on https://en.cppreference.com/w/cpp/language/coroutines , for those curious.) Rust coroutines evaluate to opaque…
They aren't strictly comparable. While the heap allocation may be optimised out, there is no way to use native C++ coroutines as guaranteed zero-cost construct due to the automatic heap allocation in the API. Rust's…
I should. I'm not too familiar with the process so far, but I'll find some time for it. These functions are indeed generally sound (also for `Rc`), as any value that cares would be `!Unpin`, which would still bar access…
There's actually a direct mention of that in my post already, but it's all the way near the bottom in the "Weakening non-moveability" section. It probably goes a bit too far to link in the intro, so I inlined a quick…
That's understandable, I originally come from about the same position too, with a bit less functional programming background. I updated the intro to also cover that angle:…
Something else that I didn't mention in the post is that `Pin<Box<T>>` is `From<Box<T>>` (so it can be cast directly, and here without reallocation or such), and this could also be implemented for (other)…
There's a hole or oversight in `Arc`'s API in this regard, annoyingly. The function you're looking for would be something like pub fn get_mut_pinned(this: &mut Pin<Arc<T>>) -> Option<Pin<&mut T>> , which for…
This is why I insist on never calling it "pinned pointer" in the post, even if not explicitly. I'm aware the term is used in the standard library docs (for context: `Pin`'s tagline is "A pinned pointer."), but in my…
"Trivially movable" means anyone can take an instance (that they own) and copy its data (just the plain memory cells) to a new location with a new address, then continue to use that instance at that new location without…
Hmm… I'd say for IO-bound tasks/loading in a DBMS yes, async/await coroutines are the correct abstraction, since you're waiting to reschedule on external notice and normally don't want to spin-wait (or you could block…
It's "Tokio". Coroutines in Rust are a native language feature and their API is part of `std`, but the executors indeed come from community libraries. Tokio is one option, but as long as you don't contextually fork (for…
Ah, you're right, I missed it because it's callee-controlled in C++. (See Heap Allocation and Promise on https://en.cppreference.com/w/cpp/language/coroutines , for those curious.) Rust coroutines evaluate to opaque…
They aren't strictly comparable. While the heap allocation may be optimised out, there is no way to use native C++ coroutines as guaranteed zero-cost construct due to the automatic heap allocation in the API. Rust's…
I should. I'm not too familiar with the process so far, but I'll find some time for it. These functions are indeed generally sound (also for `Rc`), as any value that cares would be `!Unpin`, which would still bar access…
There's actually a direct mention of that in my post already, but it's all the way near the bottom in the "Weakening non-moveability" section. It probably goes a bit too far to link in the intro, so I inlined a quick…
That's understandable, I originally come from about the same position too, with a bit less functional programming background. I updated the intro to also cover that angle:…
Something else that I didn't mention in the post is that `Pin<Box<T>>` is `From<Box<T>>` (so it can be cast directly, and here without reallocation or such), and this could also be implemented for (other)…
There's a hole or oversight in `Arc`'s API in this regard, annoyingly. The function you're looking for would be something like pub fn get_mut_pinned(this: &mut Pin<Arc<T>>) -> Option<Pin<&mut T>> , which for…
This is why I insist on never calling it "pinned pointer" in the post, even if not explicitly. I'm aware the term is used in the standard library docs (for context: `Pin`'s tagline is "A pinned pointer."), but in my…
"Trivially movable" means anyone can take an instance (that they own) and copy its data (just the plain memory cells) to a new location with a new address, then continue to use that instance at that new location without…