Elektrine lite

← Feed

@diondokter@fosstodon.org

Post #2028354

2026-05-04 19:31 UTC

@chrysn Could? Well yes of course in the literal sense of the word. Futures have surprisingly few guarantees, so them being lazy is one of the only ones. If I were to guess, you would not get consensus on this. Luckily you can do it manually fairly easily: fn foo() -> impl Future { // Eager sync stuff ... async { // Deferred async stuff ... } }

Replies (1)

  • @chrysn@chaos.social 2026-05-22 15:32

    @diondokter@fosstodon.org Thinking of this again while implementing an embassy_net_driver_channel made me realize that there can be a `fn f(data: &'t [u8]) -> impl Future + use<> { … }`, and the data buffer can be freed before the future completes. 🤯

    Open ##2773964