Conversation
Deploying ferrous-systems-rust-training with
|
| Latest commit: |
37f9357
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0c69eb7f.ferrous-systems-rust-training.pages.dev |
| Branch Preview URL: | https://futures-might-not-be-cold.ferrous-systems-rust-training.pages.dev |
Contributor
Author
|
replaced by speaker note to clarify that some work might already start during the future construction |
listochkin
reviewed
Aug 31, 2026
| Note: | ||
|
|
||
| * While the future itself might be cold, its construction might already start or do some of | ||
| the work related to the future. |
Member
There was a problem hiding this comment.
If the future is creates using async then you can't do any custom work in the constructor.
If you make a future manually (using implementation Future for StructType or poll_fn), then you can customize the behavior.
Member
There was a problem hiding this comment.
I think this was a nod towards:
fn do_process() -> impl Future<Foo> {
hal::start_dma();
async {
hal::wait_dma().await
}
}Where a sync function both does some work, and returns a future that must be polled. I don't know how often this comes up in practice.
Member
There was a problem hiding this comment.
See also
rust-training/example-code/qemu-common/src/cmsdk_uart/asynch.rs
Lines 196 to 253 in f063b58
impl Future for CustomType to get Drop behaviour for the Future.
robamu
force-pushed
the
futures-might-not-be-cold
branch
from
September 1, 2026 14:12
0c794c4 to
d3ffe7b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the embedded contexts, we can have futures that already start part of the work (e.g. UART transmission futures which loads the FIFO with the initial bytes). So those are not really "cold", or at the very least I think calling them "cold" is confusing.
Maybe we can just remove this? I think the knowledge that futures need to be executed/resolved is sufficient.