February 1, 2020
When Static and Dynamic Meet in Rust!
The STATIC nature of Rust is well known of to anyone who has used the Rust compiler.
But the world that Rust and Rust programs live in is DYNAMIC.
When STATIC meets DYNAMIC, difficulties can arise.
Bryce Fisher-Fleig, in the Returning Trait Objects article, gives an EXAMPLE of such a situation.
The PROBLEM situation he poses is simple to me: there is one function and the value returned from this function could be of a different type depending on dynamic conditions not known at compile time!
We are informed of some POSSIBLE SOLUTIONS that do not work.
And we are informed of one that DOES.
I do not know if there is a better Rust way of approaching this situation, but if there is, I would love to LEARN about it!