Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide pieces of the API #20

Open
MinusGix opened this issue Sep 7, 2023 · 0 comments
Open

Hide pieces of the API #20

MinusGix opened this issue Sep 7, 2023 · 0 comments

Comments

@MinusGix
Copy link
Member

MinusGix commented Sep 7, 2023

There's various pieces of the API that should probably be hidden or made non-constructable.
Hiding functions would allow us to later replace or alter the code behind them without breaking 'good' plugins because they shouldn't be using them directly. Making some structures non-constructable would let us add fields in the future easily.

  • handle_rpc is an internal function, it should be #[doc(hidden)].
  • Ideally users should never have to use object_from_stdin/object_from_stdout. These should probably be internal, and we just pass the requests/notifications to the plugin.
  • parse_stdin should be hidden
  • Http should be made non-constructable (add a hidden empty marker field), just in case.
  • VoltEnvironment should be made non-constructable.
    • Really I think VoltEnvironment should have to be created if you want to use it.
    • Would let us cache values in the future.
  • PluginError should perhaps be #[non_exhaustive] in case we want to add other error kinds with types in the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant