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

Q: How to share implementation between scoped APIs and dynamic APIs #5

Open
crlf0710 opened this issue Apr 1, 2024 · 0 comments
Open

Comments

@crlf0710
Copy link

crlf0710 commented Apr 1, 2024

Static-analysis friendly scoped APIs

What's the common API pattern

Failure modes

Dynamic APIs still with dependency

On process-level resources: std::io::stdin() and std::io::Stdin:

On thread-level resources: rand::random() and rand::ThreadRng:

Reference counting and interior mutability

More approaches?

How to share code as much as possible if your crate wants to support both or more.

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