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

Limit length #5

Open
nrc opened this issue Nov 28, 2022 · 1 comment
Open

Limit length #5

nrc opened this issue Nov 28, 2022 · 1 comment

Comments

@nrc
Copy link
Owner

nrc commented Nov 28, 2022

For fixed size reads or partial writes, you might not want to read/write to the end of the buffer. In the borrowed case, you would just slice for this, but that isn't possible here. So we probably want some mechanism to limit the usable length of the buffer. For writes, we read out of the filled part, so we should have a start limit too. I.e., we want to have a slice view of the underlying buffer.

An alternative is to properly support 'owned slices' but I think this gets complicated and requires reference counting or similar.

@nrc
Copy link
Owner Author

nrc commented Nov 29, 2022

I think this is addressed by dd0fb41 but I'm leaving this issue open until I'm sure it's a good solution

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