mastodon.sdf.org is part of the decentralized social network powered by Mastodon.
"I appreciate SDF but it's a general-purpose server and the name doesn't make it obvious that it's about art." - Eugen Rochko

Administered by:

Server stats:

2.4K
active users

Learn more

argv minus one

@gamingonlinux

Hmm.

It looks like Microsoft wanted DEV_BROADCAST_HDR to be a discriminated union, but with the different variants having different sizes, presumably so that they could introduce new variants later without breaking existing code.

This is the correct way to accomplish that.

does something similar for trait object downcasting: check if the desired type is the same as the actual type, and if so, cast the pointer.

Check: doc.rust-lang.org/1.85.0/src/c
Cast: doc.rust-lang.org/1.85.0/src/c

any.rs - source

Source of the Rust file `library/core/src/any.rs`.

doc.rust-lang.org