Chris Krycho on Nostr: I *just* realized why #Rust futures do not implement `Display` or even `Debug`: ...
I *just* realized why #Rust futures do not implement `Display` or even `Debug`: because Rust futures are lazy and you would have to poll them to do that. Even if you could manage the plumbing (!), printing a future would poll it, which could change the behavior of the system!
(File under: maybe this should have been obvious, but I never actually stopped to reason through it until just now!)
Published at
2024-09-18 23:30:24Event JSON
{
"id": "d9daad2b4ec33144c9f77e1d8a93ae99df33dab1a3e2bd94e62bdd35cbd01845",
"pubkey": "991bc7c784f618e159be31da0ff2f015752d8b491b6a40e42eb8608e8aee513f",
"created_at": 1726702224,
"kind": 1,
"tags": [
[
"t",
"rust"
],
[
"proxy",
"https://mastodon.social/users/chriskrycho/statuses/113161157002993963",
"activitypub"
]
],
"content": "I *just* realized why #Rust futures do not implement `Display` or even `Debug`: because Rust futures are lazy and you would have to poll them to do that. Even if you could manage the plumbing (!), printing a future would poll it, which could change the behavior of the system!\n\n(File under: maybe this should have been obvious, but I never actually stopped to reason through it until just now!)",
"sig": "7b920ab7d671b10b6e77679cb525bb41df7c7239e95cf3b3019c87861d4c705646023cbdb60274cb68431ed8a8f555cfb281bfed2109b69d13e73e28a56b8afa"
}