Skip to content

Use builder pattern for ApcbIoOptions #115

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

Closed
daym opened this issue Nov 28, 2023 · 0 comments
Closed

Use builder pattern for ApcbIoOptions #115

daym opened this issue Nov 28, 2023 · 0 comments
Assignees

Comments

@daym
Copy link
Collaborator

daym commented Nov 28, 2023

Right now, ApcbIoOptions can only be constructed via ApcbIoOptions::default().

It would be nice to allow the user to build any options using the usual Rust builder pattern.

https://rust-unofficial.github.io/patterns/patterns/creational/builder.html

The reason why this is done using functions instead of struct fields:

  1. So we can, in the future, add options (with defaults) without all call sites having to adapt.
  2. So we can have compatibility shims for the deprecated options if we ever decide to change what the options are.
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