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

Add trait that supports either arrays or leases #53

Open
mkeeter opened this issue Aug 19, 2024 · 1 comment
Open

Add trait that supports either arrays or leases #53

mkeeter opened this issue Aug 19, 2024 · 1 comment

Comments

@mkeeter
Copy link
Contributor

mkeeter commented Aug 19, 2024

It would be convenient to write code that's generic against Leased<W, [u8]> and &mut [u8] (and Leased<R, [u8]> and &[u8]). Such a trait should live in the idol_runtime crate.

Edit: I found BufReader and BufWriter, which are close, but are reader/writer-flavored rather than array-flavored.

@cbiffle
Copy link
Collaborator

cbiffle commented Aug 20, 2024

Seems reasonable. The only reason the existing API uses read/writer flavors is because that's what the code needed when I wrote the API --- in the interest of not adding speculative features before they're used. A random-access variant would make perfect sense.

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

2 participants