make libpathrs Rust configuration sane #24
Labels
api/rust
Related to the Rust API.
ideas welcome
An open problem which doesn't have a clear resolution.
Milestone
The current method of configuration is a really bad idea (exposing structure internals of
Root
is going to cause problems, I can feel it in my bones). So we should instead use a different design, but it's unclear to me what the best approach is:Just have methods to set (and possibly get) configuration of the object. It's not the nicest thing in the world, but it's fairly workable.
The most common approach is the "builder" method. The issue with it is whether there should be a way to modify the configuration after you've consumed the builder. If yes, then what is the point of the builder (you could just modify the configuration and not have a builder -- which is the alternative proposal). If no, and then how do we expose the builder method through the C API -- we'd need to have C builders which is just going to be absolutely awful.
Some follow-on questions (and my tentative answers):
Do people really care about modifying the configuration after the fact?
How do we deal with the
try_clone
case and modifying the configuration of the copy (ditto forfrom_file_unchecked
)?The text was updated successfully, but these errors were encountered: