Programming, Cloudflare, Rust, Serverless, Workers.
down to a specific call just to that function. fn just_call(me: impl Fn(), maybe: bool) { if maybe { me() } } Such behaviour (called static dispatch) is the default in Rust and is preferable for performance reasons. However, if we don’t know all the possible types at compile-time, Rust allows us to