News for hackers. Stuff that matters.
Re:Apt Rust requirement raises questions by steveklabnik on Tuesday November 25, 2025 @11:31AM (#46047481)
I agree that the signature for process_handler is weird, but you could steelman it to take a borrowed trait object instead, which would have an extra sigil.

The handler function isn't actually unnecessary, or at least, it isn't superfluous: by default, the signature would include 'a on self as well, and that's probably not what you actually want.

I do think that the example basically boils down to the lifetime syntax though, and yes, while it's a bit odd at first, every other thing that was tried was worse.

Re:Apt Rust requirement raises questions by creata on Tuesday November 25, 2025 @11:33AM (#46047510)
> The handler function isn't actually unnecessary, or at least, it isn't superfluous: by default, the signature would include 'a on self as well, and that's probably not what you actually want.

To clarify, I meant the 'a in `Box<dyn Handler + 'a>` in the definition of `process_handler` is unnecessary. I'm not saying that the <'a> parameter in the definition of Handler::handle is unnecessary, which seems to be what you think I said, unless I misunderstood.

Re:Apt Rust requirement raises questions by steveklabnik on Tuesday November 25, 2025 @11:46AM (#46047700)
Ah yes, I misunderstood you in exactly that way, my apologies.