How does this compare to "Accept interfaces, return structs" in Go?
How does this compare to "Accept interfaces, return structs" in Go?
Posted Apr 25, 2024 12:40 UTC (Thu) by davecb (subscriber, #1574)Parent article: Existential types in Rust
I use interfaces to tell an implementation "here's what you need to do" in a program that has a bazillion plugins to do related things.
I then return a struct that has a concrete structure, not visible to the caller, that contains the type the implementation needs.
I then return a struct that has a concrete structure, not visible to the caller, that contains the type the implementation needs.
Off-topic, I laughed out loud when I read the definition: existential versus universal quantifier, backwards E versus upside-down A .
I trained as a logician, but it's been so long now that I thought "existential" was being used in the sense we use in "existential risks", ie, risks that could cause the collapse of human civilisation. Types that could cause Rust to disappear in a little cloud of smoke (:-))
