Closed niklasdewally closed 2 months ago
lines......: 73.2% (4278 of 5844 lines)
functions..: 50.1% (450 of 898 functions)
branches...: no data found
lines......: 73.2% (4285 of 5856 lines)
functions..: 50.2% (451 of 898 functions)
branches...: no data found
In Rust, a trait T is "object safe" if it can be stored and used as a type. Non object safe traits do not allow type erasure or the storing any implementer of the trait as a Box.
See: https://doc.rust-lang.org/reference/items/traits.html#object-safety
The point of the solver adaptor in the first place was to be solver independent and generic - therefore, object safety is necessary. In particular, @gskorokhod wanted to put this into the global context so that we can define what SolverAdaptor to use depending on CLI arguments.
The idea is that we should "be a Java interface". The associated types of the trait are not needed, and the encapsulation should be strengthened such that the adaptor implementation does not even need to announce what types it uses internally in the first place.
On testing, context compiles with a SolverAdaptor inside it. Actually adding this properly is work for a future PR.
Credit for this goes entirely to @gskorokhod (I just code monkeyed!).