Joshua Barretto on Nostr: Something I find myself often wanting to reach for in #rustlang is a `FnPtr` trait: ...
Something I find myself often wanting to reach for in #rustlang is a `FnPtr` trait: akin to `Fn`/`FnMut`/etc. except where the function is guaranteed to be representable as a function pointer. There are many times when I want to carry something over, say, an FFI boundary without needing the caller of some API to explicitly pass a function pointer.
Published at
2023-09-16 21:52:02Event JSON
{
"id": "25c75b1c83d91620d03a4a1c35b485d9f519c839473769994a9ac2876cc39aab",
"pubkey": "53c9b7321f9105b9f4ea7e5c226178bc338d8c635c9fd45dfbaa058037cc9201",
"created_at": 1694901122,
"kind": 1,
"tags": [
[
"t",
"rustlang"
],
[
"proxy",
"https://social.coop/users/jsbarretto/statuses/111077039936149103",
"activitypub"
]
],
"content": "Something I find myself often wanting to reach for in #rustlang is a `FnPtr` trait: akin to `Fn`/`FnMut`/etc. except where the function is guaranteed to be representable as a function pointer. There are many times when I want to carry something over, say, an FFI boundary without needing the caller of some API to explicitly pass a function pointer.",
"sig": "34e0b1b909fdfe0c1a988d108d3a91e1defe36111e72bd1ded6a7beef79e35e2353a5f86107c885268edabee04a2f7d26f43328f9bcd7d8a46575bf5212e0f09"
}