sa_family
sa_family
Posted Nov 16, 2025 22:40 UTC (Sun) by randomguy3 (subscriber, #71063)In reply to: sa_family by da4089
Parent article: A struct sockaddr sequel
In C terms, a Rust enum is most similar to a union (plus a value to tell you which union variant is active). Imagine the potential issues with allowing new union variants to be added at runtime - most notably, how would you safely destroy such a value?
Of course (as with most things in software), this could be solved, but it would cost you (in performance, ergonomics, safety and/or another axis of flexibility).
